Buffered sockets don't work with UDP due to the way that UDP works. Buffering
only works with streaming sockets. If you need per-client buffering of data,
you need to implement that yourself by determining how to represent each client.
Oh, well, too bad this proc doesn't support buffered sockets.
Thanks, weird that I missed recvFrom when looking through the library.
Yep, see the following example:
import net
let listener = newSocket(sockType=SOCK_DGRAM, protocol=IPPROTO_UDP)
# listen on port
listener.bindAddr(Port())
var
data = newString(1024) # receive buffer of 1024 bytes
senderAddress: string
Is it possible to get the source address of a received UDP packet using the net
library?