Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the listen() function call is not needed when use UDP socket?

Tags:

sockets

I'm just curious about this question, can any one tell me?

like image 858
dragonfly Avatar asked Nov 19 '11 13:11

dragonfly


1 Answers

TCP is a streaming protocol between a server and clients. The protocol is reliable and requires separate state for each server<>client stream. The connect protocol, initiated with listen/accept, sets up this server<>client connection state. UDP is a connectionless, unreliable datagram, (message) protocol, so no need to listen for new connections - datagrams can come in in any order from any source.

like image 50
Martin James Avatar answered Oct 20 '22 11:10

Martin James