• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling an open socket server

 
Mike Cunningham
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks,

Mike
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!