Network Socket Blocking

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Blog the Haggis

    #1

    Network Socket Blocking

    Hi all,

    I've written a program which distributes binary data to a number of clients
    via TCP. The program runs perfectly unless one of the client programs hangs
    and then it freezes while waiting for the socket.send(Dat a) method to
    complete.

    I've tried all of these socket options to overcome this event:

    'Set send timeout to 2 seconds:
    _Client.SetSock etOption(Socket OptionLevel.Soc ket,
    SocketOptionNam e.SendTimeout, 2000)
    'Stop the socket from blocking:
    _Client.Blockin g = False
    'Don't allow network delays:
    _Client.SetSock etOption(Socket OptionLevel.Soc ket, SocketOptionNam e.NoDelay,
    1)

    But it still hangs when one of the client programs enters a bad state.

    Is there any way to determine when a client socket connection has entered a
    bad state and then stop trying to send the data?

    Any suggestions would be greatly appreciated.

    -Duncan


Working...