Sockets problem

  • Thread starter Thread starter raza
  • Start date Start date
R

raza

Hi,
I am using C# sockets and sending data packets of 25k per packet in
busy loop and receiving data on the same sockets in another thread. I
use select to check avaiability of data.

The problem is that after a while (variable amount of time) the
Socket.Send call hangs , hangs mean it never returns neither throws
exception making my app stuck.

Any help/suggestion would be highly appreciated.

Regards
 
Set the SendTimeout SocketOption on the Socket. Then wrap your Send calls
inside a try/catch block to catch the exception that will be raised if the
timeout is reached.
 
Back
Top