美文网首页
Linux Socket Communication Mache

Linux Socket Communication Mache

作者: cutelittlePanda | 来源:发表于2018-03-17 11:03 被阅读0次

The machenism of the socket communication.

1. Server End

2. Client End

1. Server End:

1). create a new socket, then binds it to a tuple of (host, port);

2). listen to this socket all the time, once connection comes, receive messages, and then sends out responses.

3). after communication, close this socket.

2. Client End:

a). get the target server information on hostname or ip, and the port;

b).create a socket, and connect to target server.

c). send message to server via socket, and receive response from server.

d). close socket after the transports.

相关文章

网友评论

      本文标题:Linux Socket Communication Mache

      本文链接:https://www.haomeiwen.com/subject/yztkqftx.html