Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I get rid of TIME_WAIT when using the port leaving the client side as fixed in TCP communication?

What I have tried:

I'm trying to modify the program at the request of the client company, but no matter what, TIME_WAIT keeps occurring.

The development environment is Windows 10, the language is C#, and the development tool is Visual Studio 2015.

The equipment program reports MES to the client's server.

At this time, I was asked to bind the Local Port of the Client.

C#
client.m_Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);

client.m_Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, new LingerOption(true, 0));


I'll write a sample program for the test.

I applied both server-side and client-side codes above, but no matter how I change it, TIME_WAIT keeps occurring.

Please show me how.
Posted
Updated 31-May-21 19:42pm
v4
Comments
[no name] 1-Jun-21 13:53pm    
Why do you want to get "rid" of it? Are you running out of sockets?

http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900