I think multiple sockets can be associated with same TCP port.
But can the same thing work for UDP?
I think multiple sockets can be associated with same TCP port.
But can the same thing work for UDP?
The only way to associate multiple sockets with a port in TCP is by listening and then accepting.
The purpose in that case is to give every incoming client a unique socket so as to keep their byte streams separate.
You don't need that in the case of UDP because there are no byte streams. You can write an entire UDP server using a single UDP socket. You just read, despatch to a handler for that client, the handler writes the response back via the same socket.
Yes, it is also possible to have multiple sockets using a single UDP port.