Skip to content

Commit f01a806

Browse files
Ajidotargos
authored andcommitted
doc: add optional callback to socket.end()
PR-URL: #23937 Refs: #18708 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 64c205d commit f01a806

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/net.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -684,13 +684,14 @@ listeners for that event will receive `exception` as an argument.
684684
* {boolean} Indicates if the connection is destroyed or not. Once a
685685
connection is destroyed no further data can be transferred using it.
686686

687-
### socket.end([data][, encoding])
687+
### socket.end([data][, encoding][, callback])
688688
<!-- YAML
689689
added: v0.1.90
690690
-->
691691

692692
* `data` {string|Buffer|Uint8Array}
693693
* `encoding` {string} Only used when data is `string`. **Default:** `'utf8'`.
694+
* `callback` {Function} Optional callback for when the socket is finished.
694695
* Returns: {net.Socket} The socket itself.
695696

696697
Half-closes the socket. i.e., it sends a FIN packet. It is possible the
@@ -1168,7 +1169,7 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`.
11681169
[`socket.connect(path)`]: #net_socket_connect_path_connectlistener
11691170
[`socket.connect(port, host)`]: #net_socket_connect_port_host_connectlistener
11701171
[`socket.destroy()`]: #net_socket_destroy_exception
1171-
[`socket.end()`]: #net_socket_end_data_encoding
1172+
[`socket.end()`]: #net_socket_end_data_encoding_callback
11721173
[`socket.pause()`]: #net_socket_pause
11731174
[`socket.resume()`]: #net_socket_resume
11741175
[`socket.setEncoding()`]: #net_socket_setencoding_encoding

0 commit comments

Comments
 (0)