In the first case, since opening is failing, the server decides to abort the connection following RFC6455 section 7.2.2, which states that the server should close the connection under these circumstances.
In the second case, it's a normal closing, which means sending a close frame and then waiting for a close frame in response, as described in RFC6455 section 5.5.1.
I'm using yaws-2.0.6.
If in my handle_open I return:
yaws sends WebSocket message with opcode 8 and closes the TCP connection.
However, if I accept the connection:
and later I decide to close it by using:
yaws sends WebSocket message with opcode 8 but it doesn't close the TCP connection.
Is this expected behavior?