The series of articles deal with socket programming in Linux and tries to provide various examples with explanation. Stress is placed that all articles have a suitable example provided and an explanation provided.
The articles provide a start point for one to begin their study of socket programming in Linux. Suitable sample code are provided for most cases. The sample code have their analysis based on the linux terminl “ss” tool. The “ss” tool is a powerful tool to look at various socket statistics and should be available in most Ubuntu and other linux distrbutions.
There is a lot more that can be learnt about socket programming than this site. This site provides a start and provides a few practical examples to take it forward.
Some good books to refer for socket programming are
- The Linux Programming Interface – Michael Kerrisk
- Unix Network Programming – W. Richard stevens, Bill Fenner, Andrew M. Rudoff
Happy reading
Table of Contents
- An Introduction to sockets
- A Socket Server/Client Example – TCP Stream Sockets
- A UDP Socket Connection
- Socket Based IPC- Unix Domain Sockets
- The connected UDP Socket Connection
- Abstract Namespace Socket Connections
- SocketPair Socket connection
- Sequenced socket (SOCK_SEQPACKET) connection
- Raw Sockets – An introduction
- Raw Sockets – An Introduction (continued)
- Analyzing TCP/UDP/IP headers for Raw Sockets
- Raw Socket Code with IPPROTO_TCP protocol
- Raw socket Code with IPPROTO_UDP protocol
- Using Connect and Bind on a Raw Socket
- Raw Socket Communication with Datalink Layer
- Raw Socket Code – IPPROTO_RAW Example
- Raw Socket Code – IP_HDRINCL Example
- IPv6 Socket Code Example
- Select and Poll API