Originally posted by Lasse Koskela:
java.net.Socket is not Serializable and for a reason. The Socket represents a live connection and thus cannot be serialized. The only workaround is to read the necessary info from the Socket object, serialize that info and make a new connection later on using that information.
My idea of of asking this question is that i need to implement a chat server . As the clients get connected ,the Scoket object is created on the server side . Now the next step would be to open the I/O streams on the Socket Object
I want to hold on a bit ..... i mean , i don't want to open I/O streams on a socket till the time i select a client whom i wish to talk to .
Suppose there are 5 clients connecetd and i wish to talk to the 4th one . So for this purpose i need to store the Socket Objects of all the 5 clients somewhere so that a list of connected clients can be mantained and on the basis of selection , an Input and Output streams for a specific Socket object ( the 4th one in this case)can be opened.
What can be done to achieve this kind of an objective.
one more thing ..... when this application would run on a web server ( say on
www.xyz.com)then how
would the Socket objects or anything be written to a file which would reside on the Web server.
(not on the Local System)
Thanks in advance
[ April 25, 2003: Message edited by: raghav mathur ]