File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -70,20 +70,14 @@ datagram messages. This occurs as soon as UDP sockets are created.
7070added: v0.1.99
7171-->
7272
73+ The ` 'message' ` event is emitted when a new datagram is available on a socket.
74+ The event handler function is passed two arguments: ` msg ` and ` rinfo ` .
7375* ` msg ` {Buffer} - The message
7476* ` rinfo ` {Object} - Remote address information
75-
76- The ` 'message' ` event is emitted when a new datagram is available on a socket.
77- The event handler function is passed two arguments: ` msg ` and ` rinfo ` . The
78- ` msg ` argument is a [ ` Buffer ` ] [ ] and ` rinfo ` is an object with the sender's
79- address information provided by the ` address ` , ` family ` and ` port ` properties:
80-
81- ``` js
82- socket .on (' message' , (msg , rinfo ) => {
83- console .log (' Received %d bytes from %s:%d\n ' ,
84- msg .length , rinfo .address , rinfo .port );
85- });
86- ```
77+ * ` address ` {String} The sender address
78+ * ` family ` {String} The address family (` 'IPv4' ` or ` 'IPv6' ` )
79+ * ` port ` {Number} The sender port
80+ * ` size ` {Number} The message size
8781
8882### socket.addMembership(multicastAddress[ , multicastInterface] )
8983<!-- YAML
You can’t perform that action at this time.
0 commit comments