http://leetsys.com/programs/skeletons/win32/connect.c
Very simple example of using winsock to connect to a chosen port. Grabbed most of the source from gandalf’s whois.c, so thank you gandalf. Sends the 3rd command line argument over the socket, prints the data received and then quits. Test it by telneting to an smtp server on port 25 and sending ‘helo whatever.com’, should receive some output back.