1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-23 15:51:06 +01:00

Update README.md (#466)

This commit is contained in:
William Desportes 2024-09-28 02:45:02 +02:00 committed by GitHub
parent dd20ebb6cb
commit 49aacfce9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,7 @@ async fn ws(req: HttpRequest, body: web::Payload) -> actix_web::Result<impl Resp
let (response, mut session, mut msg_stream) = actix_ws::handle(&req, body)?; let (response, mut session, mut msg_stream) = actix_ws::handle(&req, body)?;
actix_web::rt::spawn(async move { actix_web::rt::spawn(async move {
while let Some(Ok(msg)) = msg_stream.next().await { while let Some(Ok(msg)) = msg_stream.recv().await {
match msg { match msg {
Message::Ping(bytes) => { Message::Ping(bytes) => {
if session.pong(&bytes).await.is_err() { if session.pong(&bytes).await.is_err() {