CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    3

    problems with recv on n/w cable unplugging

    Hi,
    In one of my programs i connect a client to my server and when i disconnect the client system from the network the recv method in the server code still keeps waiting , and when i reconnect it the parent spawns another process to handle the new client connection ( i mean its coded that way ), what i need to know is when i disconnect the client from the n/w will recv ( or read or select for that matter ) never know what happened to the client ?? or is there a better way to handle this situation ??
    Last edited by ecostar; October 18th, 2006 at 10:17 PM. Reason: abc

  2. #2
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: problems with recv on n/w cable unplugging

    An unplugged cable is not a network error, so, unless something else happens, recv() will sit there, potentially forever.

    You could implement a "keep alive" protocol if this is important to you.

    Mike

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