Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a Java application in which I need to pass details of a Socket object to remotely connected computer through a Socket... I tried it by passing the socket object in object output stream. But as "Socket" is not "serializable" it didn't work... My main idea is to get the input and Output Stream of that Socket... Actually am trying to link two different remote connection's Socket via this server's socket... Please let me know is this a good idea? Or I should think something else... Or is there any another way to do it?

Thank you...
Posted

1 solution

Pass the information you use to open the socket rather than the socket itself: the IP address and port for example.
 
Share this answer
 
Comments
Sarjit 6-Mar-14 6:53am    
But how that will help me in connecting to the input and output stream of that server side Socket?
OriginalGriff 6-Mar-14 7:11am    
It will give you the information you need to construct a new Socket and connect it.
Sarjit 6-Mar-14 8:02am    
Thank you for your quick response... I am not able to do that can you please show me some code snippet?
Thank you...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900