Choose the best description of what a socket does in computer networks.
Think about how two programs communicate over a network.
A socket is like a door or endpoint that allows two computers to send and receive data. It does not handle encryption, storage, or physical cables directly.
Identify the protocol that ensures data is delivered reliably and in order when using sockets.
Consider which protocol manages connection and guarantees delivery.
TCP is a connection-oriented protocol that ensures reliable, ordered delivery of data. UDP is faster but does not guarantee delivery. IP handles addressing, and FTP is an application protocol.
Consider a server program that creates a socket but does not bind it to any port before calling listen(). What will be the result?
Think about the role of binding in socket setup.
Binding assigns a specific port to the socket. Without binding, the server cannot listen on any port, so an error occurs.
Analyze the possible reasons a client socket cannot establish a connection to a server socket.
Consider all common causes of connection failure.
Connection failures can happen if the server is down, protocols mismatch, or network security blocks the traffic.
Explain what happens when a server socket sets the SO_REUSEADDR option before binding.
Think about how servers restart quickly after closing connections.
SO_REUSEADDR allows a socket to bind to a port even if previous connections on that port are still in the TIME_WAIT state, which helps servers restart without waiting.