-
Sockets problem
hi,
im writing this program for the internet lab of our dorm where everyone can access the net for 45min, and a server can control all times(add, decrease,send msg to user and so on) , I wrote a program using using TCPCLIENT and TCPSERVER classes, the timer is on the client, and sends its time to the server every minute,and the server can send messages to the client ( set time for timer and ,,,) the problem is if the client computer shuts down or is unexpepticly rebooted, how can the server know about it ??? is there anyway to this ?
thanks,
-
I dont think you can do anything about the unexpected reboot until the computer is up again, but you should be able to the catch the system about to shut down message.
-
can i catch it before the the application terminates? just to get a msg to the server or something
-
You should be able to capture your program's closing event
-
yes i'm using that now, but my problem is unexpected reboot on clients computer , i dont think the program will close as usual ( for example if you pull the power plug out) is there anyway to capture these kind of events, for example when the tcpclient object does it send any kind of msg to the server, before closing there connection?
-
can the use of remoting be any help?!
-
catch the ping time-out, and then u'll now that in something like 1-2 min the computer might have been rebooted
-
I dont think you can do anything if someone just pulls the plug. Once that happens it a wrap.:D
-
im not talking about the rebooted comp, im talking about the other one..at some time he will have to get an ping timeout or connection reset by peer depending on the way the reboots ocurrs
-
yeah, another way i guess is to try to connect to all clients and wait for a response every N minutes, who ever doesnt reply, and exeption is thrown and you know that he;s not there ( well at least in my situation where i know all the URI of my connecting users ), but what about remoting, i dont know much, just read something before, like we can client - activate an object on the server, since the client renews the lease , if he;s not there the object will be GC and, we can remove that client like from our online users collection, plz help out here, is this possible?