So guys, we have just taken a look regarding how server and client process can communicate with each
other using Unix domain sockets.
So let us discuss the set of APIs that we have used in our client server socket programming discussion
that we just had.
So you can see that on the client side, the API that we discussed is the connect system call and the
connect system call is used by the client to send the connection initiation request message to the server.
Right.
And the corresponding API to process the connection initiation request is the accept system call.
So Connect system call is not a blocking system call, but the accept system call is a blocking system
call.
Right.
So you can see that connect system call and accept system call are actually complementary to each other.
The connection initiation request that is generated by the client process using connect system call
is processed on the server side by accept system call.
Then once the connection between the client and the server is fully established, the client sends the
service request messages.
That is the actual data to the server using the following APIs.
In our example we have used the write system call, but there are other equivalent system calls that
is provided by the Linux operating system environment that is, send message and send to system calls.
These system calls are also used to send message from client process to server process or vice versa.
So note that here if you are using write system, call then to read a corresponding message.
On the other side, the corresponding system call is read system call.
And for send to system call the corresponding system call is received from system Call.
And if you use send message system call to send a message, then the corresponding API on the other
side to be used is the receive message system call.
So you can see that there is a 1 to 1 mapping between these system calls.
If you use write, you should use read.
If you are using send to, then you should use receive from.
And if you are using send message, then you should use receive message system call.
Also note that the receive message or receive from or read system calls.
That is all the system calls which are intended to receive a message from the other side that is from
the other process are actually blocking system calls.
So guys, let's discuss some observations or some points to be noted from the client server design and
discussion that we have so far.
So we have seen in our demonstration that when server is servicing the current client, it cannot entertain
any new client.
So this is a drawback of the server design that we have discussed and we need to alleviate this limitation.
A server can be redesigned to serve multiple clients at the same time using the concept of multiplexing.
So this will be the topic of our next discussion.
That is the concept of multiplexing.
Using multiplexing, we can redesign a server to actually handle multiple clients connections at the
same time.