现在的位置: 首页 > 综合 > 正文

Windows Sockets

2013年05月22日 ⁄ 综合 ⁄ 共 444字 ⁄ 字号 评论关闭

About Servers and Clients

There are two distinct types of socket network applications: Server and
Client. Servers and Clients have different behaviors; therefore, the process of
creating them is different. What follows is the general model for creating a
streaming TCP/IP Server and Client.

Server

  1. Initialize WSA.
  2. Create a socket.
  3. Bind the socket.
  4. Listen on the socket.
  5. Accept a connection.
  6. Send and receive data.
  7. Disconnect.

Client

  1. Initialize WSA.
  2. Create a socket.
  3. Connect to the server.
  4. Send and receive data.
  5. Disconnect.

抱歉!评论已关闭.