Home > other >  How to realize two client transfer data
How to realize two client transfer data

Time:10-09

A server IP, how via TCP or UDP protocol implementation to a client's data is sent to another client, is a PC and a lower machine, as the client, of course, there are other solutions please comment

CodePudding user response:

Each client assigned an identifier, open a thread to monitor the client's servers;
The connection is successful after each for the client to open a thread to send and receive data, receive data into the queue;
Server to open another thread to read the data in the queue, and to determine whether a particular change client online and then sends the data online, no online, put the data in the line.

CodePudding user response:

reference 1st floor ipqtjmqj response:
each client assign an identity, open a thread to monitor the client's servers;
The connection is successful after each for the client to open a thread to send and receive data, receive data into the queue;
Server to open another thread to read the data in the queue, and to determine whether a particular change client online and then sends the data online, no online, put the data in a party.
thank you
  • Related