[Original] Port and Socket

xiaoxiao2021-03-06  39

Socket - socket, socket network program communication into a program's Socket socket flowing into another program's Socket socket port number and socket, such as FTP, responsible for controlling the port 21, with a socket binding to this port ( Remembling SCTRLSocket, has been listening, once listened to a connection request, Socket Tempsocket = sctrlsocket.accept (); this time a socket on the client (a port on the client) is established with the Tempsocket on the server. A link, the TemPSocket on the server is not exclusively 21 port but also establishes a transport path with the client through the 21-port. After that, there are many client sockets that have a number of SOCKETs on the same server as Tempsocket to establish the client socket. Link .Tempsocket1, TempSocket2, TempSocket3 ............................................................................... In addition to the actual transmission design of the control command, it is of course a tempsocket (control command transmission) corresponding to a thread, after entering his thread, if data is required, in this thread: myDataSocket = sdataSocket.accept ( ); // sDataSocket is responsible for data transmission to the 20 port on the server, so many clients will not be interfere. Of course, PORT and PASV model are implemented in the program ... ......(to be continued)

转载请注明原文地址:https://www.9cbs.com/read-56608.html

New Post(0)