Skip to content

Commit ea9ee15

Browse files
jasnellrvagg
authored andcommitted
doc: port is optional for socket.bind()
per: nodejs/node-v0.x-archive#25356 originally submitted by @dcousens Reviewed By: Sakthipriyan Vairamani <[email protected]> PR-URL: #2378
1 parent 0ff6657 commit ea9ee15

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/dgram.markdown

+4-3
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,16 @@ a packet might travel, and that generally sending a datagram greater than
158158
the (receiver) `MTU` won't work (the packet gets silently dropped, without
159159
informing the source that the data did not reach its intended recipient).
160160

161-
### socket.bind(port[, address][, callback])
161+
### socket.bind([port][, address][, callback])
162162

163-
* `port` Integer
163+
* `port` Integer, Optional
164164
* `address` String, Optional
165165
* `callback` Function with no parameters, Optional. Callback when
166166
binding is done.
167167

168168
For UDP sockets, listen for datagrams on a named `port` and optional
169-
`address`. If `address` is not specified, the OS will try to listen on
169+
`address`. If `port` is not specified, the OS will try to bind to a random
170+
port. If `address` is not specified, the OS will try to listen on
170171
all addresses. After binding is done, a "listening" event is emitted
171172
and the `callback`(if specified) is called. Specifying both a
172173
"listening" event listener and `callback` is not harmful but not very

0 commit comments

Comments
 (0)