Write a `HelloErrorFrame` and shut down the write side of the stream. Errors here are swallowed — we're already on the error path.
(stream: &mut S, code: HelloErrorCode, msg: &str)
| 114 | /// |
| 115 | /// Errors here are swallowed — we're already on the error path. |
| 116 | async fn send_error<S: AsyncWrite + Unpin>(stream: &mut S, code: HelloErrorCode, msg: &str) { |
| 117 | let frame = HelloErrorFrame { |
| 118 | code, |
| 119 | message: msg.to_string(), |
| 120 | } |
| 121 | .encode(); |
| 122 | let _ = stream.write_all(&frame).await; |
| 123 | let _ = stream.flush().await; |
| 124 | let _ = stream.shutdown().await; |
| 125 | } |
| 126 | |
| 127 | #[cfg(test)] |
| 128 | mod tests { |
no test coverage detected