The `close()` function implements a TCP connection "halfClose". We have earlier came to the conclusion that a "halfClose" is a synchronous operation. After the client has sent FIN it can not send any more data and the TCP connection state is immediately "halfClosed".