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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top