GATE | GATE-CS-2017 (Set 2) | Question 23

Consider a socket API on Linux machine that supports UDP socket. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are correct ?

I. A connected UDP socket can be used to communicate
   with multiple peers simultaneously.
II. A process can successfully call connect function
    again for an already connected UDP socket.

(A) I only
(B) II only
(C) Both I and II only
(D) Neither I nor II


Answer: (B)

Explanation: I. A connected UDP socket can be used to communicate with multiple peers simultaneously is WRONG : Even if UDP is connectionless, every UDP socket has a single specified IP number and port number to connect to. Therefore we can not use same socket to connect to multiple peers simultaneously.
II. A process can successfully call connect function again for an already connected UDP socket is RIGHT : We can call connect again to connect to a new peer and disconnect previous peer if implementation allows.

Quiz of this Question



My Personal Notes arrow_drop_up