receive ( datagram -- bytes addrspec )
Networking > Packet-oriented networking

Prev:send ( bytes addrspec datagram -- )


Vocabulary
io.sockets

Inputs and outputs
datagrama datagram socket
bytesa byte-array
addrspecan address specifier


Word description
Waits for an incoming packet on the given datagram socket. Outputs the packet data, as well as the sender's address.

Errors
Throws an error if the packet could not be received.

Definition


:: receive ( datagram -- bytes addrspec )
datagram-size (byte-array) :> buf datagram-size buf datagram
receive-unsafe :> ( count addrspec ) count buf resize
addrspec ; inline