[coro_http.websocket]Fix websocket example (#651)

This commit is contained in:
qicosmos 2024-03-29 18:01:23 +08:00 committed by GitHub
parent 38e2b7bd01
commit 09aefcb51e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -183,9 +183,8 @@ async_simple::coro::Lazy<void> use_websocket() {
result.type == ws_frame_type::WS_BINARY_FRAME) {
std::cout << result.data << "\n";
}
if (result.type == ws_frame_type::WS_PING_FRAME ||
result.type == ws_frame_type::WS_PONG_FRAME) {
else if (result.type == ws_frame_type::WS_PING_FRAME ||
result.type == ws_frame_type::WS_PONG_FRAME) {
// ping pong frame just need to continue, no need echo anything,
// because framework has reply ping/pong msg to client
// automatically.