• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Calling an open socket server

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic