Hi i am building a little p2p program, implementing both the server-side and the client-side. when I lunch the client-side program, first think it does is to connect to each server in its list, send data (about the client-side) and disconnect. The next time the client-side connects to one of these servers it will be recognized.
My problem - when i tell the client-side to disconnect, i get this exception
java.io.EOFException
at java.io.DataInputStream.readUnsignedShort(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at oop.ex3.nameserver.NameServerThread.run(NameServerThread.java:24)
to disconnect i just wrote:
finally {
out.close();
in.close();
socket.close();
}
so, how do i avoid this exception? thanks!
close()statements throw an exception?