This example uses Winsock to send and receive data from one computer to another using TCP or UDP protocols. It could be client to server or client to client communication. It could even be used with a peripheral device. IPv4 and IPv6 are supported.

Win API Functions used:

accept recv
bind recvfrom
closesocket RegisterEventSource
connect ReportEvent
DeregisterEventSource RtlMoveMemory
FormatMessage send
freeaddrinfo sendto
getaddrinfo setsockopt
gethostname shutdown
getpeername socket
getsockname WNetGetUser
getsockopt WSAAddressToString
htons WSAAsyncSelect
inet_ntoa WSACleanup
ioctlsocket WSAGetLastError
listen WSASetLastError
ntohs WSAStartup

——— Last updated 10/01/2019 ———