| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,7 @@ server.bind(41234); | |||
| 30 | 30 | // Prints: server listening 0.0.0.0:41234 | |
| 31 | 31 | ``` | |
| 32 | 32 | ||
| 33 | - ## Class: dgram.Socket | ||
| 33 | + ## Class: `dgram.Socket` | ||
| 34 | 34 | <!-- YAML | |
| 35 | 35 | added: v0.1.99 | |
| 36 | 36 | --> | |
@@ -42,23 +42,23 @@ Encapsulates the datagram functionality. | |||
| 42 | 42 | New instances of `dgram.Socket` are created using [`dgram.createSocket()`][]. | |
| 43 | 43 | The `new` keyword is not to be used to create `dgram.Socket` instances. | |
| 44 | 44 | ||
| 45 | - ### Event: 'close' | ||
| 45 | + ### Event: `'close'` | ||
| 46 | 46 | <!-- YAML | |
| 47 | 47 | added: v0.1.99 | |
| 48 | 48 | --> | |
| 49 | 49 | ||
| 50 | 50 | The `'close'` event is emitted after a socket is closed with [`close()`][]. | |
| 51 | 51 | Once triggered, no new `'message'` events will be emitted on this socket. | |
| 52 | 52 | ||
| 53 | - ### Event: 'connect' | ||
| 53 | + ### Event: `'connect'` | ||
| 54 | 54 | <!-- YAML | |
| 55 | 55 | added: v12.0.0 | |
| 56 | 56 | --> | |
| 57 | 57 | ||
| 58 | 58 | The `'connect'` event is emitted after a socket is associated to a remote | |
| 59 | 59 | address as a result of a successful [`connect()`][] call. | |
| 60 | 60 | ||
| 61 | - ### Event: 'error' | ||
| 61 | + ### Event: `'error'` | ||
| 62 | 62 | <!-- YAML | |
| 63 | 63 | added: v0.1.99 | |
| 64 | 64 | --> | |
@@ -68,15 +68,15 @@ added: v0.1.99 | |||
| 68 | 68 | The `'error'` event is emitted whenever any error occurs. The event handler | |
| 69 | 69 | function is passed a single `Error` object. | |
| 70 | 70 | ||
| 71 | - ### Event: 'listening' | ||
| 71 | + ### Event: `'listening'` | ||
| 72 | 72 | <!-- YAML | |
| 73 | 73 | added: v0.1.99 | |
| 74 | 74 | --> | |
| 75 | 75 | ||
| 76 | 76 | The `'listening'` event is emitted whenever a socket begins listening for | |
| 77 | 77 | datagram messages. This occurs as soon as UDP sockets are created. | |
| 78 | 78 | ||
| 79 | - ### Event: 'message' | ||
| 79 | + ### Event: `'message'` | ||
| 80 | 80 | <!-- YAML | |
| 81 | 81 | added: v0.1.99 | |
| 82 | 82 | --> | |
@@ -91,7 +91,7 @@ The event handler function is passed two arguments: `msg` and `rinfo`. | |||
| 91 | 91 | * `port` {number} The sender port. | |
| 92 | 92 | * `size` {number} The message size. | |
| 93 | 93 | ||
| 94 | - ### socket.addMembership(multicastAddress\[, multicastInterface\]) | ||
| 94 | + ### `socket.addMembership(multicastAddress[, multicastInterface])` | ||
| 95 | 95 | <!-- YAML | |
| 96 | 96 | added: v0.6.9 | |
| 97 | 97 | --> | |
@@ -123,7 +123,7 @@ if (cluster.isMaster) { | |||
| 123 | 123 | } | |
| 124 | 124 | ``` | |
| 125 | 125 | ||
| 126 | - ### socket.addSourceSpecificMembership(sourceAddress, groupAddress\[, multicastInterface\]) | ||
| 126 | + ### `socket.addSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])` | ||
| 127 | 127 | <!-- YAML | |
| 128 | 128 | added: v13.1.0 | |
| 129 | 129 | --> | |
@@ -138,7 +138,7 @@ is not specified, the operating system will choose one interface and will add | |||
| 138 | 138 | membership to it. To add membership to every available interface, call | |
| 139 | 139 | `socket.addSourceSpecificMembership()` multiple times, once per interface. | |
| 140 | 140 | ||
| 141 | - ### socket.address() | ||
| 141 | + ### `socket.address()` | ||
| 142 | 142 | <!-- YAML | |
| 143 | 143 | added: v0.1.99 | |
| 144 | 144 | --> | |
@@ -149,7 +149,7 @@ Returns an object containing the address information for a socket. | |||
| 149 | 149 | For UDP sockets, this object will contain `address`, `family` and `port` | |
| 150 | 150 | properties. | |
| 151 | 151 | ||
| 152 | - ### socket.bind(\[port\]\[, address\]\[, callback\]) | ||
| 152 | + ### `socket.bind([port][, address][, callback])` | ||
| 153 | 153 | <!-- YAML | |
| 154 | 154 | added: v0.1.99 | |
| 155 | 155 | changes: | |
@@ -205,7 +205,7 @@ server.bind(41234); | |||
| 205 | 205 | // Prints: server listening 0.0.0.0:41234 | |
| 206 | 206 | ``` | |
| 207 | 207 | ||
| 208 | - ### socket.bind(options\[, callback\]) | ||
| 208 | + ### `socket.bind(options[, callback])` | ||
| 209 | 209 | <!-- YAML | |
| 210 | 210 | added: v0.11.14 | |
| 211 | 211 | --> | |
@@ -258,7 +258,7 @@ socket.bind({ | |||
| 258 | 258 | }); | |
| 259 | 259 | ``` | |
| 260 | 260 | ||
| 261 | - ### socket.close(\[callback\]) | ||
| 261 | + ### `socket.close([callback])` | ||
| 262 | 262 | <!-- YAML | |
| 263 | 263 | added: v0.1.99 | |
| 264 | 264 | --> | |
@@ -268,7 +268,7 @@ added: v0.1.99 | |||
| 268 | 268 | Close the underlying socket and stop listening for data on it. If a callback is | |
| 269 | 269 | provided, it is added as a listener for the [`'close'`][] event. | |
| 270 | 270 | ||
| 271 | - ### socket.connect(port\[, address\]\[, callback\]) | ||
| 271 | + ### `socket.connect(port[, address][, callback])` | ||
| 272 | 272 | <!-- YAML | |
| 273 | 273 | added: v12.0.0 | |
| 274 | 274 | --> | |
@@ -287,7 +287,7 @@ will be used by default. Once the connection is complete, a `'connect'` event | |||
| 287 | 287 | is emitted and the optional `callback` function is called. In case of failure, | |
| 288 | 288 | the `callback` is called or, failing this, an `'error'` event is emitted. | |
| 289 | 289 | ||
| 290 | - ### socket.disconnect() | ||
| 290 | + ### `socket.disconnect()` | ||
| 291 | 291 | <!-- YAML | |
| 292 | 292 | added: v12.0.0 | |
| 293 | 293 | --> | |
@@ -296,7 +296,7 @@ A synchronous function that disassociates a connected `dgram.Socket` from | |||
| 296 | 296 | its remote address. Trying to call `disconnect()` on an already disconnected | |
| 297 | 297 | socket will result in an [`ERR_SOCKET_DGRAM_NOT_CONNECTED`][] exception. | |
| 298 | 298 | ||
| 299 | - ### socket.dropMembership(multicastAddress\[, multicastInterface\]) | ||
| 299 | + ### `socket.dropMembership(multicastAddress[, multicastInterface])` | ||
| 300 | 300 | <!-- YAML | |
| 301 | 301 | added: v0.6.9 | |
| 302 | 302 | --> | |
@@ -312,7 +312,7 @@ never have reason to call this. | |||
| 312 | 312 | If `multicastInterface` is not specified, the operating system will attempt to | |
| 313 | 313 | drop membership on all valid interfaces. | |
| 314 | 314 | ||
| 315 | - ### socket.dropSourceSpecificMembership(sourceAddress, groupAddress\[, multicastInterface\]) | ||
| 315 | + ### `socket.dropSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])` | ||
| 316 | 316 | <!-- YAML | |
| 317 | 317 | added: v13.1.0 | |
| 318 | 318 | --> | |
@@ -330,21 +330,21 @@ reason to call this. | |||
| 330 | 330 | If `multicastInterface` is not specified, the operating system will attempt to | |
| 331 | 331 | drop membership on all valid interfaces. | |
| 332 | 332 | ||
| 333 | - ### socket.getRecvBufferSize() | ||
| 333 | + ### `socket.getRecvBufferSize()` | ||
| 334 | 334 | <!-- YAML | |
| 335 | 335 | added: v8.7.0 | |
| 336 | 336 | --> | |
| 337 | 337 | ||
| 338 | 338 | * Returns: {number} the `SO_RCVBUF` socket receive buffer size in bytes. | |
| 339 | 339 | ||
| 340 | - ### socket.getSendBufferSize() | ||
| 340 | + ### `socket.getSendBufferSize()` | ||
| 341 | 341 | <!-- YAML | |
| 342 | 342 | added: v8.7.0 | |
| 343 | 343 | --> | |
| 344 | 344 | ||
| 345 | 345 | * Returns: {number} the `SO_SNDBUF` socket send buffer size in bytes. | |
| 346 | 346 | ||
| 347 | - ### socket.ref() | ||
| 347 | + ### `socket.ref()` | ||
| 348 | 348 | <!-- YAML | |
| 349 | 349 | added: v0.9.1 | |
| 350 | 350 | --> | |
@@ -362,7 +362,7 @@ Calling `socket.ref()` multiples times will have no additional effect. | |||
| 362 | 362 | The `socket.ref()` method returns a reference to the socket so calls can be | |
| 363 | 363 | chained. | |
| 364 | 364 | ||
| 365 | - ### socket.remoteAddress() | ||
| 365 | + ### `socket.remoteAddress()` | ||
| 366 | 366 | <!-- YAML | |
| 367 | 367 | added: v12.0.0 | |
| 368 | 368 | --> | |
@@ -373,7 +373,7 @@ Returns an object containing the `address`, `family`, and `port` of the remote | |||
| 373 | 373 | endpoint. It throws an [`ERR_SOCKET_DGRAM_NOT_CONNECTED`][] exception if the | |
| 374 | 374 | socket is not connected. | |
| 375 | 375 | ||
| 376 | - ### socket.send(msg\[, offset, length\]\[, port\]\[, address\]\[, callback\]) | ||
| 376 | + ### `socket.send(msg[, offset, length][, port][, address][, callback])` | ||
| 377 | 377 | <!-- YAML | |
| 378 | 378 | added: v0.1.99 | |
| 379 | 379 | changes: | |
@@ -511,7 +511,7 @@ a packet might travel. Sending a datagram greater than the receiver `MTU` will | |||
| 511 | 511 | not work because the packet will get silently dropped without informing the | |
| 512 | 512 | source that the data did not reach its intended recipient. | |
| 513 | 513 | ||
| 514 | - ### socket.setBroadcast(flag) | ||
| 514 | + ### `socket.setBroadcast(flag)` | ||
| 515 | 515 | <!-- YAML | |
| 516 | 516 | added: v0.6.9 | |
| 517 | 517 | --> | |
@@ -521,7 +521,7 @@ added: v0.6.9 | |||
| 521 | 521 | Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP | |
| 522 | 522 | packets may be sent to a local interface's broadcast address. | |
| 523 | 523 | ||
| 524 | - ### socket.setMulticastInterface(multicastInterface) | ||
| 524 | + ### `socket.setMulticastInterface(multicastInterface)` | ||
| 525 | 525 | <!-- YAML | |
| 526 | 526 | added: v8.6.0 | |
| 527 | 527 | --> | |
@@ -599,7 +599,7 @@ A socket's address family's ANY address (IPv4 `'0.0.0.0'` or IPv6 `'::'`) can be | |||
| 599 | 599 | used to return control of the sockets default outgoing interface to the system | |
| 600 | 600 | for future multicast packets. | |
| 601 | 601 | ||
| 602 | - ### socket.setMulticastLoopback(flag) | ||
| 602 | + ### `socket.setMulticastLoopback(flag)` | ||
| 603 | 603 | <!-- YAML | |
| 604 | 604 | added: v0.3.8 | |
| 605 | 605 | --> | |
@@ -609,7 +609,7 @@ added: v0.3.8 | |||
| 609 | 609 | Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, | |
| 610 | 610 | multicast packets will also be received on the local interface. | |
| 611 | 611 | ||
| 612 | - ### socket.setMulticastTTL(ttl) | ||
| 612 | + ### `socket.setMulticastTTL(ttl)` | ||
| 613 | 613 | <!-- YAML | |
| 614 | 614 | added: v0.3.8 | |
| 615 | 615 | --> | |
@@ -624,7 +624,7 @@ decremented to 0 by a router, it will not be forwarded. | |||
| 624 | 624 | ||
| 625 | 625 | The `ttl` argument may be between 0 and 255. The default on most systems is `1`. | |
| 626 | 626 | ||
| 627 | - ### socket.setRecvBufferSize(size) | ||
| 627 | + ### `socket.setRecvBufferSize(size)` | ||
| 628 | 628 | <!-- YAML | |
| 629 | 629 | added: v8.7.0 | |
| 630 | 630 | --> | |
@@ -634,7 +634,7 @@ added: v8.7.0 | |||
| 634 | 634 | Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer | |
| 635 | 635 | in bytes. | |
| 636 | 636 | ||
| 637 | - ### socket.setSendBufferSize(size) | ||
| 637 | + ### `socket.setSendBufferSize(size)` | ||
| 638 | 638 | <!-- YAML | |
| 639 | 639 | added: v8.7.0 | |
| 640 | 640 | --> | |
@@ -644,7 +644,7 @@ added: v8.7.0 | |||
| 644 | 644 | Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer | |
| 645 | 645 | in bytes. | |
| 646 | 646 | ||
| 647 | - ### socket.setTTL(ttl) | ||
| 647 | + ### `socket.setTTL(ttl)` | ||
| 648 | 648 | <!-- YAML | |
| 649 | 649 | added: v0.1.101 | |
| 650 | 650 | --> | |
@@ -660,7 +660,7 @@ Changing TTL values is typically done for network probes or when multicasting. | |||
| 660 | 660 | The `ttl` argument may be between between 1 and 255. The default on most systems | |
| 661 | 661 | is 64. | |
| 662 | 662 | ||
| 663 | - ### socket.unref() | ||
| 663 | + ### `socket.unref()` | ||
| 664 | 664 | <!-- YAML | |
| 665 | 665 | added: v0.9.1 | |
| 666 | 666 | --> | |
@@ -680,7 +680,7 @@ chained. | |||
| 680 | 680 | ||
| 681 | 681 | ## `dgram` module functions | |
| 682 | 682 | ||
| 683 | - ### dgram.createSocket(options\[, callback\]) | ||
| 683 | + ### `dgram.createSocket(options[, callback])` | ||
| 684 | 684 | <!-- YAML | |
| 685 | 685 | added: v0.11.13 | |
| 686 | 686 | changes: | |
@@ -719,7 +719,7 @@ method will bind the socket to the "all interfaces" address on a random port | |||
| 719 | 719 | and port can be retrieved using [`socket.address().address`][] and | |
| 720 | 720 | [`socket.address().port`][]. | |
| 721 | 721 | ||
| 722 | - ### dgram.createSocket(type\[, callback\]) | ||
| 722 | + ### `dgram.createSocket(type[, callback])` | ||
| 723 | 723 | <!-- YAML | |
| 724 | 724 | added: v0.1.99 | |
| 725 | 725 | --> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments