This week's book giveaways are in the Scala and Android forums. We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line! See this thread and this one for details.
Hallo, I am writing a client/server program and I am having troubles passing sockets among classes.
Basically, the client connects to a login manager, which checks credentials and then passes the socket to another class for further communication.
If i close the DataInputStream and the DataOutputStream, I get a "socket closed" exception when i try to open new ones in the "other" class (although I did not close the socket itself), whereas if I do not close the streams, I get a EOFException.
Maybe my login manager thread closes the socket when it dies, even though that socket is referenced in another thread?
I am starting to think that it is not possible to achieve what I was trying to do and that I'd need to open a new socket, but I'd rather not if possible so please let me know if it can be done...
I am not posting the code now because it's quite long, but I'll certainly will if needed.