Reputation: 716
I use a process to download a file from server by HttpWebRequest. And then I use IpHelper to get the TCP table of the current time. I find that the TCP table contains two rows which are used by the current process. It means that, the current process uses two TCP ports to download the file.
My question is that, isn't that one process uses only one TCP port (by default)?
Thanks for any help. (Sorry for my poor English..)
Upvotes: 0
Views: 343
Reputation: 4666
There is no constraint on a process to use only one port. A process can use as many ports as it requires. Of course, there are limits to that, but those limits are much higher than 2 ports. For example, the number of available ports itself is only 64K. And also most of the processes would have a limit on the number of file descriptors (each socket needs to have one). But, once again, these limits are much higher than 2 ports.
Upvotes: 2