method
TCPSocket.shutdown
halfClose?: boolean
): void;
Shuts down one half of the connection. With no argument, sends a FIN: the socket can still receive data but can no longer send it. With true, stops receiving data. Calls the shutdown(2) syscall internally.
@param halfClose
If true, shuts down the read side. If false or omitted, shuts down the write side. Defaults to false.
// Stop sending data, but allow receiving
socket.shutdown();
// Stop receiving data
socket.shutdown(true);