|
-
Sep 20th, 2003, 02:58 AM
#1
Thread Starter
Registered User
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,
-
Sep 20th, 2003, 07:53 AM
#2
Frenzied Member
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.
-
Sep 20th, 2003, 11:53 AM
#3
Thread Starter
Registered User
can i catch it before the the application terminates? just to get a msg to the server or something
-
Sep 20th, 2003, 12:22 PM
#4
Frenzied Member
You should be able to capture your program's closing event
-
Sep 20th, 2003, 12:28 PM
#5
Thread Starter
Registered User
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?
-
Sep 20th, 2003, 01:05 PM
#6
Thread Starter
Registered User
can the use of remoting be any help?!
-
Sep 20th, 2003, 02:02 PM
#7
yay gay
catch the ping time-out, and then u'll now that in something like 1-2 min the computer might have been rebooted
\m/  \m/
-
Sep 20th, 2003, 02:10 PM
#8
Frenzied Member
I dont think you can do anything if someone just pulls the plug. Once that happens it a wrap.
-
Sep 20th, 2003, 02:14 PM
#9
yay gay
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
\m/  \m/
-
Sep 20th, 2003, 02:18 PM
#10
Thread Starter
Registered User
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|