CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Location
    Melbourne
    Posts
    27

    IP Server - detecting dead connection

    Hi all,

    I'm developing an IP client/server program for transferring files. It's all working (surprisingly!) well, except for:-

    If a client is uploading a file, and that connection is unexpectedly terminated (phone line drops out, client PC crashes, etc) the connection remains on my server and leaves a permanently open partially transmitted file on the server's hard drive (until such time as I manually close the connection and delete the file).

    How then, do I detect that a connection has closed unexpectedly, and gracefully close the socket at the server end, and delete the partially transmitted file?

    Mark

  2. #2
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487
    Usually, the server should manage this by monitoring the clients activity. Definitely, the client should be closed by force when no more activity is happening in a span of time (idle).. Usually this is about 300 secs idle, before the server kicks the client..
    Busy

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

Featured