Java Socket Communications Infrastructure

Socket Communications Model

Here Insert Picture Description
The left is a server-side server socket, the right is the client.

Socket implementation steps

Here Insert Picture Description
For details, see the API documentation

ServerSocket

Here Insert Picture Description

int port //代表端口号   int backlog //请求进入连接队列的最大长度  	InetAddress bindAddr //服务器将绑定到的本地InetAddress

The following summary affix a method of ServerSocket
Here Insert Picture Description
Here Insert Picture Description

Socket

Here Insert Picture Description
Paste the following summary of a method of Socket:
Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/m0_38083682/article/details/91417867