Results 1 to 10 of 10

Thread: Sockets problem

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61

    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,

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    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.

  3. #3

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61
    can i catch it before the the application terminates? just to get a msg to the server or something

  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    You should be able to capture your program's closing event

  5. #5

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61
    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?

  6. #6

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61
    can the use of remoting be any help?!

  7. #7
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    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/

  8. #8
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    I dont think you can do anything if someone just pulls the plug. Once that happens it a wrap.

  9. #9
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    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/

  10. #10

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61
    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
  •  



Click Here to Expand Forum to Full Width