Struct websockets::WebSocketWriteHalf [−][src]
pub struct WebSocketWriteHalf { /* fields omitted */ }
Expand description
The write half of a WebSocket connection, generated from WebSocket::split()
.
This half can only send frames.
Implementations
Flushes incoming events from the read half. If the read half received a Ping frame,
a Pong frame will be sent. If the read half received a Close frame,
an echoed Close frame will be sent and the WebSocket will close.
See the documentation on the WebSocket
type for more details
about events.
Sends a Text frame over the WebSocket connection, constructed
from passed arguments. continuation
will be false
and fin
will be true
.
To use a custom continuation
or fin
, construct a Frame
and use
WebSocketWriteHalf::send()
.
This method will flush incoming events.
See the documentation on the WebSocket
type for more details
about events.
Sends a Binary frame over the WebSocket connection, constructed
from passed arguments. continuation
will be false
and fin
will be true
.
To use a custom continuation
or fin
, construct a Frame
and use
WebSocketWriteHalf::send()
.
This method will flush incoming events.
See the documentation on the WebSocket
type for more details
about events.
Shuts down the WebSocket connection without sending a Close frame.
It is recommended to use the close()
method instead.
Sends a Close frame over the WebSocket connection, constructed from passed arguments, and closes the WebSocket connection.
As per the WebSocket protocol, the server should send a Close frame in response upon receiving a Close frame. Although the write half will be closed, the server’s echoed Close frame can be read from the still open read half.
This method will flush incoming events.
See the documentation on the WebSocket
type for more details
about events.
Sends a Ping frame over the WebSocket connection, constructed from passed arguments.
This method will flush incoming events.
See the documentation on the WebSocket
type for more details
about events.