socket.end([data[, encoding]][, callback])
-
data<string> | <Buffer> | <Uint8Array> -
encoding<string> 仅当数据为string时使用。默认值:'utf8'。¥
encoding<string> Only used when data isstring. Default:'utf8'. -
callback<Function> 套接字完成时的可选回调。¥
callback<Function> Optional callback for when the socket is finished. -
返回:<net.Socket> 套接字自身
¥Returns: <net.Socket> The socket itself.
半关闭套接字。即,它发送一个 FIN 数据包。服务器可能仍会发送一些数据。
¥Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data.
有关详细信息,请参阅 writable.end()。
¥See writable.end() for further details.