The process of creating a socket is as follows

来源:互联网 发布:杭州网络文化节 编辑:程序博客网 时间:2024/04/30 06:08
 

TCP: The server creates a socket, binds the IP and Port, listens on connections, accepts a connection, sends and receives messages, and closes the socket. The client creates a socket, connects to the server, sends and receives messages, and close the socket.

UDP: The server creates a socket, binds the IP and Port, and receives messages. The client creates a socket, sends messages.