method Socket.prototype.endSocket.prototype.end(callback?: () => void): thisDeprecatedHalf-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data. See writable.end() for further details. Parametersoptionalcallback: () => voidOptional callback for when the socket is finished. Return TypethisThe socket itself. Socket.prototype.end(buffer: Uint8Array | string,callback?: () => void,): thisDeprecatedParametersbuffer: Uint8Array | stringoptionalcallback: () => voidReturn TypethisSocket.prototype.end(str: Uint8Array | string,encoding?: BufferEncoding,callback?: () => void,): thisDeprecatedParametersstr: Uint8Array | stringoptionalencoding: BufferEncodingoptionalcallback: () => voidReturn Typethis