Skip to content

Commit c757255

Browse files
author
Matt Crummey
committed
doc: Update rinfo object definition for UDP message event
Detailing fields of object
1 parent 8264a22 commit c757255

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

doc/api/dgram.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,14 @@ datagram messages. This occurs as soon as UDP sockets are created.
7070
added: 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's address
78+
* `family` {String} The address's family `'IPv4'` or `'IPv6'`
79+
* `port` {Number} The sender's port
80+
* `size` {Number} The message size
8781

8882
### socket.addMembership(multicastAddress[, multicastInterface])
8983
<!-- YAML

0 commit comments

Comments
 (0)