The code for the AF_UNIX Abstract Namespace datagram socket code example can be found at this link. The APIs and the connection steps are the same for the code as a AF_UNIX UDP socket connection code. The difference is that the socket path is an abstract path. code snippets from the server code to create […]
The Abstract Namespace AF_UNIX Datagram Socket code example
The APIs and the steps in establishing data transfer are Similar to a AF_UNIX Datagram socket connection. For the interested reader, the AF_UNIX datagram socket details can be read at the below link locations. AF_UNIX Datagram code example AF_UNIX Datagram code analysis The difference being that the path for the client and the server are […]
Analyzing the Abstract Namespace stream socket code
The code for an Abstract Namespace Unix domain (AF_UNIX) socket is provided at the link here. As can be seen in the server and client code, the steps to connect to the stream socket all remain the same on the server and the client side relative to any other stream socket connection. The difference in […]
Abstract Namespace AF_UNIX stream socket code example
To get a basic understanding of an abstract Namespace socket connection, refer the article provided here. To create a socket connection path which does not have an entry in the filesystem, the below method is used const char *path= “#unix_socket.sock”; The ‘#‘ in the above name will be replaced with ‘\0‘ (Null byte) when it […]
Abstract Namespace Socket Connections
When we create Unix Domain (AF_UNIX) sockets, we create a socket path in the file system, but what if we do not create a specific file-system path for the socket connection. The abstract namespace socket allows the creation of a socket connection which does not require a path to be created. Abstract namespace sockets disappear […]
Analyzing the connected UDP Socket code example
The connected UDP socket code example can be found here. An interesting things about this socket connection is that there is no accept/listen API on the server side as is present in a TCP stream socket. In an UDP socket, normally the client does not use connect API (though it can) but in this socket […]
The Connected UDP Socket Code Example
Some interesting aspects of the code for an UDP connected socket code are as below Both bind to their respective endpoints Both endpoints invoke connect command to connect to one another both know the endpoint that they are going to connect to The client port chosen in the sample code is 50001 and the server […]
The Connected UDP socket code – setup
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 […]