Re: Question about sockets

2017-11-24 Thread euant
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.

Re: Question about sockets

2017-11-24 Thread dawkot
Oh, well, too bad this proc doesn't support buffered sockets.

Re: Question about sockets

2017-11-23 Thread dawkot
Thanks, weird that I missed recvFrom when looking through the library.

Re: Question about sockets

2017-11-23 Thread euant
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

Question about sockets

2017-11-23 Thread dawkot
Is it possible to get the source address of a received UDP packet using the net library?