APPLICATION LAYER
SOCKET INTERFACE PROGRAMMING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
receive()
|
|
socket()
|
|
listen()
|
|
socket()
|
Detailed explanation-1: -The bind() method of Java Socket class binds the socket to a local address. If the specified address is null, then the system will automatically pick up a port number and a valid local address to bind with the socket.
Detailed explanation-2: -The following code opens a connection to a server: Socket socket = new Socket( server, port ); Once our socket instance is connected to the server we can start obtaining input and output streams to the sever. Input streams are used to read data from the server while output streams are used to write data to the server.
Detailed explanation-3: -Establish a Connection. The very first step is to establish a socket connection. Communication. In order to communicate over a socket connection, streams are used for both input and output the data. Closing the connection. 17-Jun-2021