Note:if statements always use braces {}. Avoid the following error-prone form:
if (condition) //AVOID! THIS OMITS THE BRACES {}!statement;
A <-data.frame(c('A','A','B','C','C','A','C','B','A'),c(3,1,7,6,5,4,2,9,8))
names(A) <-c('name','number')
A <- A[order(A$name, A$number),]
A <- A[!duplicated(A$name),]
while (true) {
try {
setConnect(server.accept());
} catch (IOException e) {
e.printStackTrace();
}
new Thread(new IncomingHandler(getConnect())).start();
}
while (true) {
try {
Socket accepted = server.accept();
new Thread(new IncomingHandler(accepted)).start();
} catch (IOException e) {
e.printStackTrace();
}
}
public static Socket getConnect() {
return connect;
}
public static void setConnect(Socket connect) {
Server.connect = connect;
}