TcpListener problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have created a client-server application using TcpListener and TcpClient.
But the TcpListener stops listening after some amount of time if the client
does not send any data.

What is the default timeout of TcpListener?
How can we change it?

Thanks
 
Reshma,

You might want to look at setting the socket options or check the Max
Connections because after you call the Start method on a TcpListener it will
continue to listen for and accept incoming connections until you call the
Stop method or it has queued MaxConnections. You can check out the
SetSocketOption method to set either one of these parameters.

I hope this helps.

------- example:

s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout,
1000);
 
Back
Top