pub struct ServerSocket { /* private fields */ }Available on crate feature
connect-server only.Expand description
A WebSocket an S2 Connect server accepted, as a transport an io::Driver can pump.
io::WebSocket is the client’s side of the same thing. They
are separate types because the two halves come from different libraries — a client
dials with tokio-tungstenite, a server upgrades with axum — and neither wants to
depend on the other’s stream type.
Implementations§
Source§impl ServerSocket
impl ServerSocket
Sourcepub fn ending_with(self, session: &LiveSession) -> Self
pub fn ending_with(self, session: &LiveSession) -> Self
Close this socket when session ends — when its pairing is undone.
websocket_router does this for you; a host that upgrades sockets itself pairs
each with the LiveSession it registered.
Trait Implementations§
Source§impl Debug for ServerSocket
impl Debug for ServerSocket
Source§impl TextTransport for ServerSocket
impl TextTransport for ServerSocket
Source§async fn send_text(&mut self, text: String) -> Result<(), Error>
async fn send_text(&mut self, text: String) -> Result<(), Error>
Available on crate feature
tokio only.Send one message.
Source§async fn recv_text(&mut self) -> Result<Option<String>, Error>
async fn recv_text(&mut self) -> Result<Option<String>, Error>
Available on crate feature
tokio only.Wait for one message.
None when the peer closed cleanly. Read moreSource§async fn recv(&mut self) -> Result<Option<Received>, Error>
async fn recv(&mut self) -> Result<Option<Received>, Error>
Available on crate feature
tokio only.Wait for one frame, reporting the ones that only prove the peer is alive — a pong,
a ping — as
Received::Alive. Read moreAuto Trait Implementations§
impl !Freeze for ServerSocket
impl !RefUnwindSafe for ServerSocket
impl !Sync for ServerSocket
impl !UnwindSafe for ServerSocket
impl Forget for ServerSocket
impl Move for ServerSocket
impl Send for ServerSocket
impl Unpin for ServerSocket
impl UnsafeUnpin for ServerSocket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more