This example illustrates a simple TCP server that accepts incoming client connections. Once a client connection is established, a thread is spawned to read data from the client and echo it back (if the echo option is not disabled).
cl -o Server Server.c ws2_32.lib
Command line options:
server [-p:x] [-i:IP] [-o]
-p:x Port number to listen on
-i:str Interface to listen on
-o Receive only, don’t echo the data back

This sample is the echo client. It connects to the TCP server, sends data,
and reads data back from the server.
cl -o Client Client.c ws2_32.lib
Command Line Options:

client [-p:x] [-s:IP] [-n:x] [-o]
-p:x Remote port to send to
-s:IP Server’s IP address or hostname
-n:x Number of times to send message
-o Send messages only; don’t receive