Results 1 to 2 of 2

Thread: Socket closed

  1. #1

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    Socket closed

    I posted this a while ago, but I can't seem to get an answer or find one elsewhere. Anyway, how does one know when a NetworkStream or TcpClient's connection is closed? Right now I'm doing something like this:
    Code:
    try
    {
        while(_nstream != null)
        {
           //read / write
        }
    }
    catch
    {
       // socket closed?
    }
    but this never seems to work. the connection will be terminated by the remote host, but you wouldn't know it... any suggestions?
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    look over pscode.com they have plenty of examples about that
    \m/\m/

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