You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transition into closed state only occurs on READING a close frame. (#14)
Invoking `close` should transition into the closed state. Receiving a close
frame also needs to make the same transition, but shouldn't close the framer.
Protocol errors should immediately close the connection (sending the close frame
if possible). Rework the code to make this possible.
# If we're already closed, then we don't need to send a close frame. Otherwise, according to the RFC, we should echo the close frame. However, it's possible it will fail to send if the connection is already closed.
146
-
unless@state == :closed
147
-
close!
148
-
send_close(code,reason)
149
-
end
145
+
# On receiving a close frame, we must enter the closed state:
# Send a control frame with data containing a specified control sequence to begin the closing handshake. Does not close the connection, until the remote end responds with a close frame.
0 commit comments