Datagram sockets

Static methods

staticcreateSocket(options:SocketOptions, ?callback:Null<MessageListener>):Socket

staticcreateSocket(type:SocketType, ?callback:Null<MessageListener>):Socket

Creates a datagram Socket of the specified types.

Takes an optional callback which is added as a listener for 'message' events.

Call socket.bind if you want to receive datagrams. socket.bind will bind to the "all interfaces" address on a random port (it does the right thing for both udp4 and udp6 sockets). You can then retrieve the address and port with socket.address().address and socket.address().port.