Category Archives: Python

Socket Programming in Python

Python program to fetch domain whois data using sockets

By | October 20, 2012

Whois The whois information of a domain name provides various details like registrar, owner, registration date, expiry date etc. The whois information is provided by the corresponding whois servers of the registrars. The first step is to contact which provides the actual whois server of a domain name. Next the particular whois server is… Read More »

Programming udp sockets in python

By | August 6, 2016

UDP sockets UDP or user datagram protocol is an alternative protocol to its more common counterpart TCP. UDP like TCP is a protocol for packet transfer from 1 host to another, but has some important differences. UDP is a connectionless and non-stream oriented protocol. It means a UDP server just catches incoming packets from any… Read More »

Raw socket programming in python (Linux)

By | October 11, 2012

Raw sockets allow a program or application to provide custom headers for the specific protocol(tcp ip) which are otherwise provided by the kernel/os network stack. In more simple terms its for adding custom headers instead of headers provided by the underlying operating system. Raw socket support is available natively in the socket api in linux…. Read More »

Receive full data with the recv socket function in python

By | August 7, 2012

In an earlier article we saw how to send and receive data in python using sockets. Lets take a quick example : #Socket client example in python import socket #for sockets import sys #for exit #create an INET, STREAMing socket try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) except socket.error: print ‘Failed to create socket’ sys.exit() print ‘Socket… Read More »