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

    How do I know if a connection is still connectd?

    Hello,
    Is there any way in C++ to find if a tcp connection is still connected or lost connection.

    I'm trying to do something like this:

    if(is still connected)
    {
    //code...
    }

    Thanks,
    Alaa
    allomeen is online now Edit/Delete Message

  2. #2
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: How do I know if a connection is still connectd?

    In general you don't.

    You may not always get a "notification" when a connection fails.

    If the connection has been lost, then when you try and use it, it will fail.
    That is how you know.
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

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