CodePudding user response:
A well. Can be many people for water?CodePudding user response:
A port can only be a application service listening, not by multiple application service monitoring, but the application service can be multiple client connections, this is the socket programming, when a port is bound to a socket service, you can use the multithreaded way to deal with multiple client connection, the client connection is this port, only server for each client has a corresponding thread to handle, and the client will be randomly assigned to a port connected to the server by the OS,But if there are two service A and B, if port 8080 is used by A service, then it cannot be used again, B
CodePudding user response:
Can enable multiple threads to listen to the same port!Socket. The Bind () of the next step is to Socket. Listen (), Listen here, you can enable multiple threads to perform at the same time,