listen() won't work on a datagram socket since there is no connection to set up or tear down. After you
bind() the socket you can immediately begin sending packets by using
sendto() to specify the recipient address. You can use
recv() or even
read() to receive packets, but you should use
recvfrom() if you also want to know who sent the packet (e.g. so you can reply to them).
If you want to talk to a specific host, you can (but don't need to) use
connect() on a datagram socket. In this case,
connect() won't actually establish a connection with the remote host; it will just set the socket's default destination, so you can use functions like
write() that don't let you specify a destination.