• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to stop server?

 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • 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,
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic