I have a program that calls another java program whose basic purpose is to open a server socket, listen for a response, and then close the server socket.
I would prefer to open the socket for responses once and be able to get a handle on it when needed.
If anyone can inform me of the process for this or throw in a snippit of code to get me started I would really appreciate it.
posted 12 years ago
I think you're saying that you want to leave the socket open. To do that, don't close the socket. Just save the Socket somewhere you can get to it and keep using it. Keep in mind that there may be other things that interfere with keeping an unused socket connection open for long, for example a firewall.