mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-30 10:42:55 +01:00
Added ws::Message::Nop, no-op websockets message
This commit is contained in:
parent
c126713f40
commit
3220777ff9
@ -1,6 +1,10 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## [0.1.0-alpha.2] - 2019-xx-xx
|
## [0.1.0-alpha.2] - 2019-03-29
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Added ws::Message::Nop, no-op websockets message
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ pub enum Message {
|
|||||||
Pong(String),
|
Pong(String),
|
||||||
/// Close message with optional reason
|
/// Close message with optional reason
|
||||||
Close(Option<CloseReason>),
|
Close(Option<CloseReason>),
|
||||||
|
/// No-op. Useful for actix-net services
|
||||||
|
Nop,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `WebSocket` frame
|
/// `WebSocket` frame
|
||||||
@ -87,6 +89,7 @@ impl Encoder for Codec {
|
|||||||
Parser::write_message(dst, txt, OpCode::Pong, true, !self.server)
|
Parser::write_message(dst, txt, OpCode::Pong, true, !self.server)
|
||||||
}
|
}
|
||||||
Message::Close(reason) => Parser::write_close(dst, reason, !self.server),
|
Message::Close(reason) => Parser::write_close(dst, reason, !self.server),
|
||||||
|
Message::Nop => (),
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user