Results 1 to 3 of 3

Thread: TCP Connection Status

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    155

    TCP Connection Status

    Hi:
    I'm trying to find out if anyone know how to check the current status of TCP connection? I'm using C#.

    If I have a TCPclient waiting to connect to a TCPlistener, half way during the connection, somehow the connection dropped or Tcplistener having a problem or accidentally shut down, how would i know the TCPclient status is the latest? I could not use TCPclient.connected status as it is only true for connection for the first time. If I used Socket.connected, it is the same as TCPclient.connected.

    Can some one tell me how to do this? VB6 winsocks always provided the winsock connection status. how about .NET?

    Thanks

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: TCP Connection Status

    I'm not sure I understand your question. What status are you looking to retrieve? The Connected property tells you if it is connected or not, but since that is not enough...what are you missing?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    155

    Re: TCP Connection Status

    Quote Originally Posted by Atheist
    I'm not sure I understand your question. What status are you looking to retrieve? The Connected property tells you if it is connected or not, but since that is not enough...what are you missing?
    Ah, Yes, Have you ever try this:

    a) Let both Client and Server connected.

    b) Then Shut the Server down.

    c) The Client.Connected property will stayed True. Which is not correct.

    I tried many many times. That why I asked this question. If you compared with VB6, I can verify the current connection status continously.

    May be I'm wrong. Can you share how you managed the status in C#?

    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