Releases: reqshark/mill
Releases · reqshark/mill
v0.3.0
v0.2.3
v0.2.2
v0.2.1
v0.1.1
v0.1.0
udprecva(s, sz, fn)
a libuv integrated async version of udprecv operation.
the parameters are a listening socket, a maxsize in bytes of the inbound msg and a callback that will fire with an Object
parameter containing the buffer buf
and origin address addr
of inbound. for example:
const lib = require('libmill')
const ipaddr = lib.iplocal(5555)
const s = lib.udplisten(ipaddr)
const recva = lib.udprecva
recva(s, 255, function (msg) {
var buf = String(msg.buf) // msg.buf is a node buffer of the packet body
var addr = msg.addr // string address of packet origin
});