Category Archives: Socket Programming

Socket programming tutorials in C, Python, Perl, Php, Java and Winsock

Browse Sub-Categories:

Java socket programming Tutorial – How to code Client and Server

By | August 5, 2020

Socket programming in Java This is a quick guide/tutorial to learning socket programming in Java. The Socket class is documented at http://docs.oracle.com/javase/1.4.2/docs/api/java/net/Socket.html To summarise the basics, sockets are the fundamental “things” behind any kind of network communications done by your computer. For example when you type www.google.com in your web browser, it opens a socket… Read More »

How to Get IP Whois Data in C with Sockets on Linux – Code Example

By | August 7, 2020

Theory The whois information of an ip address provides various details like its network, range, isp etc. This information is maintained by various regional registry servers. Read the wikipedia article on regional internet registries for more information. There are a total of 5 regional registries spanning various geographical regions of the world. For example if… Read More »

Winsock tutorial – Socket programming in C on windows

By | July 25, 2020

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 »

Get ip address from hostname in C with Linux sockets

By | July 31, 2020

Socket applications often need to convert hostnames like google.com to their corresponding ip address. This is done through dns requests. The socket api in linux provides functions like gethostbyname and getaddrinfo that can be used to perform the dns requests and get the ip address. 1. gethostbyname The first method uses the traditional gethostbyname function… Read More »