dgram_socket.setMulticastTTL()

socket.setMulticastTTL(ttl) ttl <Number> Integer Sets the IP_MULTICAST_TTL socket option. While TTL generally stands for "Time to Live", in this context it specifies the number of IP hops that a packet is allowed to travel through, specifically for multicast traffic. Each router or gateway that forwards a packet decrements the TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. The argument passed to to socket.setMulticastTTL() is a number of hops between 0 and

dgram_socket.setMulticastLoopback()

socket.setMulticastLoopback(flag) flag <Boolean> Sets or clears the IP_MULTICAST_LOOP socket option. When set to true, multicast packets will also be received on the local interface.

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.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.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.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.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.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

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.