Skip to main content

write_message

Function write_message 

Source
async fn write_message<W, M>(writer: W, msg: Option<&M>) -> Result<()>
where W: AsyncWrite + Unpin, M: Message,
Expand description

Write a message into the given writer.

The message can be None, in which case an empty message is written. This is used to implement keepalives. At the receiver, empty messages are ignored, but they do reset the read timeout.