What Is the Difference Between a Port and a Socket?
This Was a Question Raised by One of the Software Engineers in My Organisation. I'm Interested in the Broadest Definition. 3 36 Answers 1 2 Next Summary a Tcp...
This was a question raised by one of the software engineers in my organisation. I'm interested in the broadest definition.
36 Answers
Summary
A TCP socket is an endpoint instance defined by an IP address and a port in the context of either a particular TCP connection or the listening state.
A port is a virtualisation identifier defining a service endpoint (as distinct from a service instance endpoint aka session identifier).
A TCP socket is not a connection, it is the endpoint of a specific connection.
There can be concurrent connections to a service endpoint, because a connection is identified by both its local and remote endpoints, allowing traffic to be routed to a specific service instance.
There can only be one listener socket for a given address/port combination.