我们可以做一个服务器,让客户端接入就可**双方交互数据,可以相互聊天**了。
First of all, the server:
create a server, once a client connection comes in, we create a child process to continuously receive data, one is to continuously send data.
Server code:
Client code:
Run the server first, connect the client to the connection, and then send data to each other.
Server running process:
client running process: