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
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 ]
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher