4 ms·
EDIT: I was wrong, see child comments and the sibling comment from jacuqesm. --- Yes, it is listening on a single port, but accepted connections bind to a sep
by forkerenok 4y ago
EDIT: I was wrong, see child comments and the sibling comment from jacuqesm.
---
Yes, it is listening on a single port, but accepted connections bind to a separate socket.
Here's how it works under the hood:
> The accept() call creates a new socket descriptor with the same properties as socket and returns it to the caller. [...] The new socket descriptor cannot be used to accept new connections. The original socket, socket, remains available to accept more connection requests.
Pulled this from random IBM zOS docs, but it's in compliance with the Unix standard: https://www.ibm.com/docs/en/zos/2.4.0?topic=functions-accept-accept-new-connection-socket https://www.ibm.com/docs/en/zos/2.4.0?topic=functions-accept...
- tgma 4y agoSeparate socket; does not mean a separate [server] port.
- forkerenok 4y agoYes, you're right! Huge gap in understanding on my side.
- DougN7 4y agoI don’t understand - how is it not a server port? When a datagram arrives from the network it’s addressed to the server’s IP and a port (and from a client IP and port). How is the data delivered to the correct socket if not through the 5-tuple (which includes server port) to socket mapping?
- tgma 4y agoIt can be distinguished via its client IP and port.