Category Archives: Winsock

Socket programming with winsock

Receive full data with recv socket function in C

By | September 8, 2012

recv The recv function is used to receive data on a socket. For example here is the code to fetch the home page of The output might be something like this $ gcc simple_client.c && ./a.out Connected Data Send Reply received HTTP/1.1 200 OK Cache-Control: no-cache, no-store Pragma: no-cache Content-Type: text/html; charset=utf-8 Vary: Accept-Encoding… Read More »

Winsock tutorial – Socket programming in C on windows

By | December 26, 2011

Socket programming with winsock This is a quick guide/tutorial to learning socket programming in C language on Windows. “Windows” because the code snippets shown over here will work only on Windows. The windows api to socket programming is called winsock. Sockets are the fundamental “things” behind any kind of network communications done by your computer…. Read More »

TCP Connect Port Scanner Source Code in C with Winsock

By | April 30, 2009

Tcp connect port scanning TCP connect() scanning is the most basic form of TCP scanning. The program performs a connect() command on those ports of the target machine which are to be checked. If the port is open then the connect() command will succeed and a connection will be established. If the port is closed… Read More »

Raw socket programming on windows with Winpcap

By | January 13, 2008

Raw sockets with winpcap A previous post explains how to send on windows xp. However the winsock api has limited raw socket support in windows versions greater than windows xp+sp1. Therefore winpcap has to be used to send raw packets on higher windows versions. Winpcap is a packet driver useful for packet capturing and sending… Read More »