ServerSocket multiple client connectivity problems (original author: cnzrs)

xiaoxiao2021-03-06  164

(Original author: cnzrs)

Under Nonblocking mode;

1. When Serversocket1 gets new connections to users

Serversocket1.socket.activeConnections gets the current connection number serversocket1.socket.connections [i] .socketHandle gets the socket of each connection

Thus, the correspondence between I and SocketHandle in Connections [i] can save this correspondence in the record array.

2. When it is necessary to communicate with the client, determine the client's socketHandle to select Connections [i] to send.

?

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

New Post(0)