Results 1 to 3 of 3

Thread: Proper Client/Server Disconnect procedure

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    USA
    Posts
    150

    Proper Client/Server Disconnect procedure

    Ok new quesion.
    What is the proper accepted way a Client disconnects from a server?
    Does the client send a disconnect request. The Server reply then do say
    TcpClient.GetStream.Close () etc
    or am I making to much work for myself?

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Proper Client/Server Disconnect procedure

    Depends how sure you need to be that a client has disconnected in a graceful way. I would normally just do TcpClient.Close and that is it but if you need to know when a client disconnects then yeah implement some kind of 'goodbye' routine that alerts the server. Although I dont quite see why the server would need to reply before the client can disconnect because if the client sends this goodbye signal and the server does not respond then there is not a lot more the client can do anyway, it should probably just assume that the server has either disconnected its session or is down, so it may as well carry on with whatever it would do even if the server had acknowledged the goodbye command.
    Last edited by chris128; Oct 15th, 2009 at 09:30 AM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    USA
    Posts
    150

    Re: Proper Client/Server Disconnect procedure

    Good stuf thanks.

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