I"m going to write a simple web server with python to listen for requests on one port, and then process them on another port to establish a
TCP connection. Because the client sends the request with the destination port number, how can the server establish a TCP connection on another port?
such as
clientSocket.connect(xxxx, port1)
then the server:
connectionSocket, addr = serverSocket.accept()
has a connection been established on the port1
port? How do I establish a connection on the port2
port?