Search code examples
windowstcp

Can I establish more than 1 TCP connections to same server on same port from same single client? Specifically to port 445


Can I establish more than 1 TCP connections to same server on same port ? For example :

Connection 1: machine A to Machine B on port 445

Connection 2: machine A to Machine B on port 445

Without terminating previously established connection 1. If yes, do i need to do any setting to enable such scenario ?


Solution

  • Yes, you can. Without any special setting.

    That's exactly what happens when you start, let's say Internet Explorer and Mozilla Firefox and navigate to the same site with both.

    Behind the scene to connect to the server, machine A opens a socket using whatever port number and tries to connect to machine B port 445. Machine B, who was listening on port 445 can accept this incoming connection, and uses another socket using whatever other port number to connect it to. In the end, the actual TCP connection is established between whatever port en machine A and whatever port on machine B. On machine B, port 445 is left for listening only (and can accept other connections).