Does not properly close the underlying TCP connection if the other side initiates the close handshake
lexi-lambda opened this issue · comments
RFC 6455 § 5.5.1 says:
After both sending and receiving a Close message, an endpoint considers the WebSocket connection closed and MUST close the underlying TCP connection. The server MUST close the underlying TCP connection immediately; the client SHOULD wait for the server to close the connection but MAY close the connection at any time after sending and receiving a Close message, e.g., if it has not received a TCP Close from the server in a reasonable time period.
However, if the remote initiates the close handshake, this library fails to close the TCP sockets. The issue is here:
racket-rfc6455/net/rfc6455/rfc6455/conn.rkt
Lines 67 to 76 in abdf009
While rfc6455-close!
explicitly closes the input and output ports, this code path does not, so they are never closed.