I hope there are Actix maintainers here who could answer this question. I have got an Actix server which sends data to clients via a websocket. As far as I can see a server can cause infinite outgoing buffer queue growth. Sending either text or binary via websocket context does not provide a mechanism to handle the cases of the outgoing buffer overflow or other errors. Is it by design? How can I know if a server exhausted outgoing buffer on the TCP level sending many websocket messages to a client?
impl<A> WebsocketContext<A>
where
A: Actor<Context = Self>,
{
/// Write payload
///
/// This is a low-level function that accepts framed messages that should
/// be created using `Frame::message()`. If you want to send text or binary
/// data you should prefer the `text()` or `binary()` convenience functions
/// that handle the framing for you.
#[inline]
pub fn write_raw(&mut self, msg: Message) {
self.messages.push_back(Some(msg));
}
/// Send text frame
#[inline]
pub fn text<T: Into<String>>(&mut self, text: T) {
self.write_raw(Message::Text(text.into()));
}
/// Send binary frame
#[inline]
pub fn binary<B: Into<Bytes>>(&mut self, data: B) {
self.write_raw(Message::Binary(data.into()));
}