Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

check if server is online

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi:
I do the assignment with socket. I meet a problem that how to check if server is online?
In this application, if server shutdown and restart again, client should re-connect it again.
Thanks.
regards.
Paul
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,


In this application, if server shutdown and restart again, client should re-connect it again.


In my design, if the server shut down, I just popped up a dialog to notify the user and disabled everything but exit and the help files. In order to reconnect, the user had to start a new client.
When you say shutdown, do you mean exit the application? If so and you still want to notify clients when the server comes back up, you have to have some sort of persistence scheme to hold connected clients. It could be a simple property file that you log clients to whenever they connect and remove when they disconnect. You could even use Data itself to create a client log database. Either way, whenever the server comes up, it would read the property file or database and send a message to all previously connected clients that the server was now up.
Hope this helps,
Michael Morris
[ September 08, 2002: Message edited by: Michael Morris ]
reply
    Bookmark Topic Watch Topic
  • New Topic