Category : "Socket Programming"

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

C code to perform IP whois

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 an ip address is allocated to some ...

Winsock tutorial – Socket programming in C on windows

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. For example when you type www.google.com in ...

Handle multiple socket connections with fd_set and select on Linux

Handle multiple socket connections When writing server programs using sockets , it becomes necessary to handle multiple connections at a time , since a server needs to serve multiple clients. There are many ways to do so. On linux this can be done in various ways like forking , threading , select method etc. In this tutorial we shall use the select method ...

Socket programming in C on Linux – tutorial

TCP/IP socket programming in C This is a quick tutorial on socket programming in c language on a Linux system. "Linux" because the code snippets shown over here will work only on a Linux system and not on Windows. The is called winsock and we shall go through it in another tutorial. Sockets are the "virtual" endpoints of any kind of ...

Gui whois client in python with wxpython

Wxpython is the python port of wxwidgets gui library. On ubuntu wxpython can be installed from synaptic. On windows it can be downloaded from the website wxpython.org And here is a small program that pops up a simple window , to take a domain name and perform a whois for that domain. #!/usr/bin/python #@author Silver Moon #@email [email protected] import wx import socket import thread #A class which will ...

C program to get a domain’s whois information using sockets on Linux

Whois A whois client is a program that will simply fetch the whois information for a domain/ip address from the whois servers. The code over here works according to the algorithm discussed here. Code /* * @brief * Whois client program * * @details * This program shall perform whois for a domain and get you the whois data of that domain ...

Get local ip in C on linux

Local Ip address The local ip is the source ip in IP packets send out from a system. When the system is a part of a local area network then the local ip in most cases is something like 192.168.*.* . The network interface (eth0) is assigned an ip address of that range. However when the machine is connected to internet ...

Code a packet sniffer in C with winpcap

Winpcap Winpcap is a packet capture library for Windows used for packet sniffing and sending raw packets. Wireshark is a popular sniffer tool that uses winpcap to sniff packets. Here is a sample code which shows how winpcap can be used to sniff incoming packets on a particular interface. Code /* Simple Sniffer with winpcap , prints ethernet , ip , tcp , udp and ...

Get mac address from ip in winsock

Mac address or hardware address is a 48bit (6 character) wide address assigned to a network interface. It is important for the packet delivery between 2 devices like your computer and the router. Ethernet protocol uses the mac address to deliver it to the right network node. It looks like this 00-1E-58-B8-D4-69 ( the dash is not relevant). Mac address ...

Winpcap compile error in pcap-stdinc.h in vc++ 6.0

When compiling winpcap in your program on Visual C++ 6.0 you might get an error like this : Compiling... main.cpp c:\codes\include\pcap-stdinc.h(79) : error C2144: syntax error : missing ';' before type 'unsigned int' c:\codes\include\pcap-stdinc.h(79) : fatal error C1004: unexpected end of file found Error executing cl.exe. And it will point to the following lines in pcap-stdinc.h typedef _W64 unsigned int uintptr_t; typedef _W64 int ...

Pages:«123456»


Connect with us