Unix Socket

Unix Socket Tutorial

Sockets are communication points on the same or different computers to exchange data. Sockets are supported by Unix, Windows, Mac, and many other operating systems. The tutorial provides a strong foundation by covering basic topics […]

Unix Socket

What is a Socket?

Sockets allow communication between two different processes on the same or different machines. To be more precise, it’s a way to talk to other computers using standard Unix file descriptors. In Unix, every I/O action […]

Unix Socket

Unix Socket – Client Server Model

Most of the Net Applications use the Client-Server architecture, which refers to two processes or two applications that communicate with each other to exchange some information. One of the two processes acts as a client […]

Unix Socket

Unix Socket – Structures

Various structures are used in Unix Socket Programming to hold information about the address and port, and other information. Most socket functions require a pointer to a socket address structure as an argument. Structures defined […]

Unix Socket

Unix Socket – IP Address Functions

Unix provides various function calls to help you manipulate IP addresses. These functions convert Internet addresses between ASCII strings (what humans prefer to use) and network byte ordered binary values (values that are stored in […]

Unix Socket

Unix Socket – Core Functions

This chapter describes the core socket functions required to write a complete TCP client and server. The following diagram shows the complete Client and Server interaction −   The socket Function To perform network I/O, […]

Unix Socket

Unix Socket – Helper Functions

This chapter describes all the helper functions, which are used while doing socket programming. Other helper functions are described in the chapters −Ports and Services, and Network Byte Orders. The write Function The write function attempts to write nbyte bytes […]

Unix Socket

Unix Socket – Server Examples

To make a process a TCP server, you need to follow the steps given below − Create a socket with the socket() system call. Bind the socket to an address using the bind() system call. For a server socket […]

Unix Socket

Unix Socket – Client Examples

To make a process a TCP client, you need to follow the steps given below &minus ; Create a socket with the socket() system call. Connect the socket to the address of the server using the connect() system call. […]

Unix Socket

Unix Socket – Summary

Here is a list of all the functions related to socket programming. Port and Service Functions Unix provides the following functions to fetch service name from the /etc/services file. struct servent *getservbyname(char *name, char *proto) […]