Implemented WebSocket handshake

This commit is contained in:
2021-05-20 21:49:42 +02:00
parent 2f67518546
commit 843f11459b
5 changed files with 144 additions and 51 deletions

View File

@ -8,6 +8,7 @@ pub enum Kind {
DatabaseError,
HttpRequestParseError,
IoError,
WebSocketError,
}
#[derive(Copy, Clone, Debug)]
@ -53,6 +54,7 @@ impl Error {
Kind::DatabaseError => "Database error",
Kind::HttpRequestParseError => "Unable to parse http request",
Kind::IoError => "IO error",
Kind::WebSocketError => "WebSocket protocol error",
},
}
}
@ -79,6 +81,7 @@ impl fmt::Display for Error {
Kind::DatabaseError => "database error",
Kind::HttpRequestParseError => "unable to parse http request",
Kind::IoError => "io error",
Kind::WebSocketError => "websocket protocol error",
}
.to_string();
if let Some(desc) = &self.desc {