The listen call is used to accept connections for connection based sockets.
listen() marks the socket referred to by sockfd as a passive socket, that is, as a socket that will be used to accept incoming connection requests using accept(2).
The sockfd argument is a file descriptor that refers to a socket of type SOCK_STREAM or SOCK_SEQPACKET.
For connectionless sockets like a UDP socket you instead need to use something like recvfrom to read messages directly from the given socket. The Zig standard library has os.recvfrom.