1 官方流程介绍
基本介绍
winsock在windows api 是有官方的说明教程的。这里只做一个简单学习记录。
官网教程地址:
https://docs.microsoft.com/zh-cn/windows/win32/winsock/getting-started-with-winsock
规范流程
Server
1 Initialize Winsock.
2 Create a socket.
3 Bind the socket.
4 Listen on the socket for a client.
5 Accept a connection from a client.
6 Receive and send data.
7 Disconnect.
Client
1 Initialize Winsock.
2 Create a socket.
3 Connect to the server.
4 Send and receive data.
5 Disconnect.