WebSocket MCQs

WebSocket MCQs

Our team has conducted extensive research to compile a set of WebSocket MCQs. We encourage you to test your WebSocket knowledge by answering these multiple-choice questions provided below.
Simply scroll down to begin!

1: The constructor which is used to create client socket is ____________.

A.   Socket(Inet Address, IP Address, int port).

B.   ServerSocket(int port).

C.   ServerSocket(int port, int maxQueue).

D.   Socket(Inet Address, int port).

2: _______protocol supports fast point to point datagram oriented model.

A.   TCP/IP.

B.   UDP.

C.   TCP.

D.   IP.

3: Which of these variables stores the number of hits that are successfully served out of cache?

A.   Hits

B.   Hitstocache

C.   Hits_to_cache

D.   Hits.to.cache

4: How many ports of TCP/IP are reserved for specific protocols?

A.   10

B.   1024

C.   2048

D.   512

5: Which of these interface abstracts the output of messages from httpd?

A.   LogMessage

B.   LogResponse

C.   Httpdserver

D.   HttpdResponse

6: _______ method is used to examine the address and port information by the socket.

A.   GetInetAddress().

B.   LocalPort().

C.   GetPort().

D.   GetLength().

7: Which methods are commonly used in ServerSocket class?

A.   Public OutputStream getOutputStream()

B.   Public Socket accept()

C.   Public synchronized void close()

D.   None of the above

8: Which constructor of DatagramSocket class is used to creates a datagram socket and binds it with the given Port Number?

A.   DatagramSocket(int port)

B.   DatagramSocket(int port, InetAddress address)

C.   DatagramSocket()

D.   None of the above

9: Which classes are used for connection-less socket programming?

A.   DatagramSocket

B.   DatagramPacket

C.   Both A & B

D.   None of the above

10: The DatagramSocket and DatagramPacket classes are not used for connection-less socket programming.

A.   True

B.   False

11: The client in socket programming must know which information’s?

A.   IPaddress of Server

B.   Port number

C.   Both A & B

D.   None of the above

12: Which steps occur when establishing a TCP connection between two computers using sockets?

A.   The server instantiates a ServerSocket object, denoting which port number communication is to occur on

B.   The server invokes the accept() method of the ServerSocket class. This method waits until a client connects to the server on the given port

C.   After the server is waiting, a client instantiates a Socket object, specifying the server name and port number to connect to

D.   All of the above

13: Which constructor of DatagramSocket class is used that it creates a datagram socket and binds it with the given Port Number?

A.   DatagramSocket(int port)

B.   DatagramSocket(int port, InetAddress address)

C.   DatagramSocket()

D.   None of the above

14: The VLF (Very Low Frequency) and LF bauds uses which propagation for communication?

A.   Ground

B.   Sky

C.   Line of sight

D.   Space

15: Which of these method is called when http daemon is acting like a normal web server?

A.   Handle()

B.   HandleGet()

C.   HandleGet()

D.   Handleget()

16: For http, ____ usually are associated with port 80 on the client and server.

A.   Methods

B.   Exchanges

C.   Sockets

D.   Actions