"Клиент не подключен к серверу"
После ввода имени
Соответственно не могу проверить работоспособность, проверки все пройдены
public class Connection implements Closeable {
private final Socket socket;
private final ObjectOutputStream out;
private final ObjectInputStream in;
public Connection(Socket socket) throws IOException{
this.socket = socket;
this.out = new ObjectOutputStream(socket.getOutputStream());
this.in = new ObjectInputStream(socket.getInputStream());
}
public void send(Message message) throws IOException {
synchronized (out) {
out.writeObject(message);
out.close();
}
}
public Message receive() throws IOException, ClassNotFoundException {
synchronized (in) {
Message result = (Message) in.readObject();
in.close();
return result;
}
}
public SocketAddress getRemoteSocketAddress(){
return this.socket.getRemoteSocketAddress();
}
public void close() throws IOException {
this.socket.close();
this.out.close();
this.in.close();
}
}