To Test the connected UDP socket code on the same host system, we need to setup two distinct endpoints so that we can test the code on the same host system. Check the interface by running the command “ifconfig” on the linux terminal. Part output on my test system is provided below. (Note – the […]
The Connected UDP Socket connection
We all hear that UDP is a connection less protocol. As also seen from the previous examples, it is observed that there is no peer connection established. But what if we wish to create an UDP socket connection and not a TCP connection between two dedicated endpoints. The connect API allows us to achieve the […]
Analyzing the Unix Domain UDP Socket Code
The Unix Domain UDP socket code can be found here. The difference between a stream socket in the Unix domain and the UDP socket in the Unix domain is that in the UDP socket, the client and the server both connect to different socket files. If we think of the stream socket as the server […]
Unix Domain UDP Socket Connection Example
The Unix Domain UDP Socket Connection follows the same method and APIs as the internet (AF_INET) UDP Socket connection. The differences between the AF_INET socket and the Unix Domain Datagram socket are as follows Instead of an IP address – a socket path for the server and the client is required. In an UDP socket […]
Analyzing the Unix Domain Stream Socket Code
The Unix domain stream socket code is provided here. As always, let us look at how the connection establishment and data transfer occurs in an Unix Stream socket connection As referenced in Wikipedia , the unix socket references the file system of the local host system and processes view the socket as file system inodes. […]
Unix Domain Stream Socket Example
Unix domain sockets are used as IPC mechanisms between processes in a host system. The Unix domain stream socket example is provided below. Analyzing The Unix Domain Stream Socket Code
Understanding the Unix Stream Socket Connection
The Unix stream socket connection follows the same set of calls as that of a stream connection as used for a internet protocol (AF_INET) stream socket connection. The connection process is provided below The structures that are used in an Unix domain stream socket differ from the internet protocol (AF_INET) stream socket connection. Also, in […]
Socket based IPC – Unix Domain Sockets
Unix domain sockets are used as a means for Inter-Process communication within the same host/operating system. The Unix domain socket uses the AF_UNIX as the Domain and can use SOCK_STREAM, SOCK_DGRAM or SOCK_SEQPACKET as the socket type. The different socket types will be discussed in a different articles. The next set of articles deals with […]
Analyzing the UDP Socket connection
The UDP socket example is provided at this link here. The initial part of the code on the server side is to create a UDP socket. Note the type field which is set to SOCK_DGRAM (as opposed to SOCK_STREAM in a stream socket connection). if (0 > (sock_udp_server = socket(AF_INET, SOCK_DGRAM, 0))) { […]
UDP Server/client example
The interested reader can refer an introduction on UDP socket connection in the previous article <A UDP Socket Connection>. In this article we look at the server/client code example and examine its intricacies in the following article. In UDP socket connection establishment – the following occurs The UDP server binds itself to a port. The […]