• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to stop server?

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, I connect applet to server by socket. When I finish browser, how can I stop server which is writen by myself?
Thanx,
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Simon,
You do not need to stop your server program... it has to continuously run to listen for connections on it's ServerSocket... if you really wanted to, I guess you could have some method in your Server that closed all the sockets connected to it and killed the server, and then in your applet's destroy() method have it send some message to the server that launched this function... However, you would have to manually start (i.e. run the server from the command line) the server again before any applet could connect to it... which is probably a bad idea...
HTH,
-Nate
 
reply
    Bookmark Topic Watch Topic
  • New Topic