5 ms·
This is a surprisingly common misconception. When you accept, you get a new socket. but it is on the same local port. You can readily see this by running 'net
by caf 15y ago
This is a surprisingly common misconception. When you accept, you get a new socket. but it is on the same local port. You can readily see this by running 'netstat' on a busy server.
- ay 15y agoAnother way to see that there are no magic "dynamically selected" potrs is to run on the server "tcpdump src x.x.x.x or dst x.x.x.x" where the x.x.x.x is your client address - and check the outputs - the packets will have ports in them. Alternatively one can read RFC793 or, better, Stevens' "TCP/IP Illustrated".
- nathanappere 15y agoJust checked it and you're right. I believed I had encoutered the behaviour I described but I do not remember in which context. Anyway glad I learned something!
- dsl 15y agoFTP.
- pavelkaroukin 15y agoI believe this comes from how FTP protocol works which do it to some extent and the reason why it do not work trough firewalls well without using passive mode.