Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ea9ee15

Browse filesBrowse 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 <thechargingvolcano@gmail.com> PR-URL: #2378
1 parent 0ff6657 commit ea9ee15
Copy full SHA for ea9ee15

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/dgram.markdown‎

Copy file name to clipboardExpand all lines: doc/api/dgram.markdown
+4-3Lines changed: 4 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.