weirenxue / socket-example

This project is an example of using Win32 API WSAStartup, socket, bind, listen, accept, recv, send and connect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This project is an example of using Win32 API WSAStartup, socket, bind, listen, accept, recv, send and connect.

Enveironment: Visual Studio Pro 2017, Windows10 x64.

  1. There is one .sln file and two projects in this repository. The project names are server and client respectively.
  2. server : The server defines the listener socket and binds it to a specific address and port. Listen to and wait for accept client's connection. Finally, receive message from client and reply message.
  3. client : The client defines the connection socket and connects to the server. Send the prepared message to the server and receive the message from the server. Close the socket and WSACleanup.

How To Use

  1. Open the server.exe.
  2. Open the client.exe.

About

This project is an example of using Win32 API WSAStartup, socket, bind, listen, accept, recv, send and connect

License:MIT License


Languages

Language:C++ 100.0%