Like my friend on the first floor said, add something. When communicating, the source port is uniformly assigned by the system process to the process requesting connection, so it is variable, that is, each connection is generally different. Port recycling management is the same as other resources. Of course, you can write your own program and apply to the system for a fixed source port every time you connect, and the system will decide whether to allocate it according to the situation. This kind of situation is rare, so it is not recommended, because it is likely that the request will fail because of the port occupation, which is not conducive to the unified management of the system.
Query the source port, you can use some tools, there are many online, you can also use the NETSTAT command, as shown in the figure.