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
Copy file name to clipboardExpand all lines: src/websocket_core.rs
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -68,15 +68,17 @@ impl Auto {
68
68
pubstructConnectionState{
69
69
/// If the user sends a close frame, we should not send a close frame back.
70
70
///
71
-
/// Must be set to `true` if the user sends a close frame.
71
+
/// Must be set to `true` if the user sends a close frame or the other side sends a close frame.
72
+
///
73
+
/// If the connection is closed, every read will return `None` and every write will return a [`WriteError::ConnectionClosed`].
72
74
pubclosed:bool,
73
75
/// Auto handling of ping/pong and close frames.
74
76
auto:Auto,
75
77
}
76
78
77
-
// TODO: add a new write error: ConnectionClosed. closed must be set to true if the user sends a close frame, if the reader read a close frame.
78
-
// Then the closed field must be set to true. Every read will then return (None, means connection closed) and every write will return a write error with ConnectionClosed.
79
-
// And then add the tests for that. If the user closes the connection or the server closed the connection, and then the user tries to read or write a frame
79
+
// TODO: Set ConnectionState.closed to true if the user sends a close frame or the other side sends a close frame.
80
+
// TODO: If ConnectionState.closed: Every read will then return (None, means connection closed) and every write will return a write error with ConnectionClosed.
81
+
// TODO: And then add the tests for that. If the user closes the connection or the server closed the connection, and then the user tries to read or write a frame
0 commit comments