it's complex,
you need to have an application that 'listens' and another that 'sends'.
in most cases you'd be speaking of the 'server' and the 'client'
respecvively.
in most cases you'd involve, not always but mostly, multi threading.
the code is too big to attach and protected by an NDA, ouch....
so all I can tell you is...
client and server must initialize the socket system with
WSAStartup(&mystruct);
the server needs to grab a socket(), listen() and accept().
accept() will wait until a new client connection has come...
the client will simply connect()....
when these two codes are made and running....
it's up to you, you can send anything you want, but remember in sockets you
can not send packets bigger than X size, defined using the ioctl() function,
generally in windows a maximum packet size if 8K, but use some code to see
this dynamically.