Ask Question
20 June, 09:06

the UDP server described needed only one socket, whereas the TCP server needed two sockets. Why? If the TCP server were to support n simultaneous connections, each from a different client host, how many sockets would the TCP server need?

+2
Answers (2)
  1. 20 June, 10:16
    0
    The UDP server described needed only one socket, whereas the TCP server needed two sockets because:

    With the UDP server, there is no welcoming socket, and all data from different clients enters the server through this one socket. With the TCP server, there is a welcoming socket, and each time a client initiates a connection to the server, a new socket is created. Thus, to support n simultaneous connections, the server would need n+1 sockets.
  2. 20 June, 12:24
    0
    UDP uses one socket and TCP requires two sockets in a transmission because UDP is a way one connectionless protocol but TCP is connection oriented.

    The TCP server that supports n simultaneous connections would require n sockets, ranging from 1 through n.

    Explanation:

    A socket is a fusion of a port number and a source IP address using a colon.

    UDP is a transport layer protocol that is unreliable, because it does not need to establish connection to transmit packets and does not retransmit dropped packets. TCP is another transport layer protocol that is reliable, establish connection and retransmit dropped packets.

    For a UDP, only one socket would be created to transmission. A socket on the client side and server side would be created in TCP connection. A server can have multiple sockets for one or different transmission protocols.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “the UDP server described needed only one socket, whereas the TCP server needed two sockets. Why? If the TCP server were to support n ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers