APPLICATION LAYER
SOCKET INTERFACE PROGRAMMING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
IP Address of Server
|
|
Port number of Server
|
|
Both A and B
|
|
Neither A nor B
|
Detailed explanation-1: -3. The client in socket programming must know which information? Explanation: The client in socket programming must know IP address of Server as it has to use that IP address in order to initialize the socket class constructor.
Detailed explanation-2: -In the client-side socket program, we need to make a socket object. Then we will connect to the port on which our server is running-12345 in our example. After that we will establish a connection by using the socket. connect() method.
Detailed explanation-3: -For a server, you usually create a socket, then bind it to a specific port, and accept connections. For the client, you create a socket, and connect to a specified address (an IP address and port pair for a TCP/IP connection). The same device can run a TCP server and client at the same time.