InterviewSolution
| 1. |
How Sockets Can Be Used To Write Client-server Applications Using A Connection-oriented Client-server Technique? |
|
Answer» Sockets can be used to write client-server applications using a connection-oriented client-server technique. Some characteristics of this technique include:
The client-server connection, when established, remains in existence until either the client or the server explicitly breaks it, much like a trouble-free telephone CALL. The socket used for this connection is called a connection-oriented socket. The socket type is specified as SOCK_STREAM. As a result, the process receiving a message processes that message by the following rules:
Functions listen() and accept() enable the server to listen for service requests. read() and write() may be used by client and server to send/receive messages; send() and recv() may also be used. Sockets can be used to write client-server applications using a connection-oriented client-server technique. Some characteristics of this technique include: The client-server connection, when established, remains in existence until either the client or the server explicitly breaks it, much like a trouble-free telephone call. The socket used for this connection is called a connection-oriented socket. The socket type is specified as SOCK_STREAM. As a result, the process receiving a message processes that message by the following rules: Functions listen() and accept() enable the server to listen for service requests. read() and write() may be used by client and server to send/receive messages; send() and recv() may also be used. |
|