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:
parent
dd20ebb6cb
commit
49aacfce9f
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user