dgram_socket.setBroadcast()

socket.setBroadcast(flag) flag <Boolean> Sets or clears the SO_BROADCAST socket option. When set to true, UDP packets may be sent to a local interface's broadcast address.

dgram_socket.send()

socket.send(msg, [offset, length,] port, address[, callback]) msg <Buffer> | <String> | <Array> Message to be sent offset <Number> Integer. Optional. Offset in the buffer where the message starts. length <Number> Integer. Optional. Number of bytes in the message. port <Number> Integer. Destination port. address <String> Destination hostname or IP address. callback <Function> Called when the message has been sent. Optional. Broadcasts a dat

dgram_socket.ref()

socket.ref() By default, binding a socket will cause it to block the Node.js process from exiting as long as the socket is open. The socket.unref() method can be used to exclude the socket from the reference counting that keeps the Node.js process active. The socket.ref() method adds the socket back to the reference counting and restores the default behavior. Calling socket.ref() multiples times will have no additional effect. The socket.ref() method returns a reference to the socket so calls

dgram_socket.dropMembership()

socket.dropMembership(multicastAddress[, multicastInterface]) multicastAddress <String> multicastInterface <String>, Optional Instructs the kernel to leave a multicast group at multicastAddress using the IP_DROP_MEMBERSHIP socket option. This method is automatically called by the kernel when the socket is closed or the process terminates, so most apps will never have reason to call this. If multicastInterface is not specified, the operating system will attempt to drop membersh

dgram_socket.close()

socket.close([callback]) Close the underlying socket and stop listening for data on it. If a callback is provided, it is added as a listener for the 'close' event.

dgram_socket.bind()

socket.bind([port][, address][, callback]) port <Number> - Integer, Optional address <String>, Optional callback <Function> with no parameters, Optional. Called when binding is complete. For UDP sockets, causes the dgram.Socket to listen for datagram messages on a named port and optional address. If port is not specified, the operating system will attempt to bind to a random port. If address is not specified, the operating system will attempt to listen on all addresses. O

dgram_socket.address()

socket.address() Returns an object containing the address information for a socket. For UDP sockets, this object will contain address, family and port properties.

dgram_socket.addMembership()

socket.addMembership(multicastAddress[, multicastInterface]) multicastAddress <String> multicastInterface <String>, Optional Tells the kernel to join a multicast group at the given multicastAddress using the IP_ADD_MEMBERSHIP socket option. If the multicastInterface argument is not specified, the operating system will try to add membership to all valid networking interfaces.

dgram.Socket

Class: dgram.Socket The dgram.Socket object is an EventEmitter that encapsulates the datagram functionality. New instances of dgram.Socket are created using dgram.createSocket(). The new keyword is not to be used to create dgram.Socket instances.

dgram.createSocket()

dgram.createSocket(options[, callback]) options <Object> callback <Function> Attached as a listener to 'message' events. Returns: <dgram.Socket> Creates a dgram.Socket object. The options argument is an object that should contain a type field of either udp4 or udp6 and an optional boolean reuseAddr field. When reuseAddr is true socket.bind() will reuse the address, even if another process has already bound a socket on it. reuseAddr defaults to false. An optional callbac