From f01a8062763e0b86a7d768a6bf7d2ba370051152 Mon Sep 17 00:00:00 2001 From: Ajido Date: Sun, 28 Oct 2018 23:19:24 +0900 Subject: [PATCH] doc: add optional callback to socket.end() PR-URL: https://github.com/nodejs/node/pull/23937 Refs: https://github.com/nodejs/node/pull/18708 Reviewed-By: Luigi Pinca Reviewed-By: Vse Mozhet Byt Reviewed-By: Trivikram Kamat --- doc/api/net.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/net.md b/doc/api/net.md index e90a3fad0ec3ec..eb48ab8d00c87f 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -684,13 +684,14 @@ listeners for that event will receive `exception` as an argument. * {boolean} Indicates if the connection is destroyed or not. Once a connection is destroyed no further data can be transferred using it. -### socket.end([data][, encoding]) +### socket.end([data][, encoding][, callback]) * `data` {string|Buffer|Uint8Array} * `encoding` {string} Only used when data is `string`. **Default:** `'utf8'`. +* `callback` {Function} Optional callback for when the socket is finished. * Returns: {net.Socket} The socket itself. 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`. [`socket.connect(path)`]: #net_socket_connect_path_connectlistener [`socket.connect(port, host)`]: #net_socket_connect_port_host_connectlistener [`socket.destroy()`]: #net_socket_destroy_exception -[`socket.end()`]: #net_socket_end_data_encoding +[`socket.end()`]: #net_socket_end_data_encoding_callback [`socket.pause()`]: #net_socket_pause [`socket.resume()`]: #net_socket_resume [`socket.setEncoding()`]: #net_socket_setencoding_encoding