listen on udp and tcp for json logs as well

This commit is contained in:
Chris Beck
2025-12-05 15:12:20 -07:00
parent a42aad48f4
commit ffa1246e51
7 changed files with 74 additions and 44 deletions
+7 -5
View File
@@ -49,11 +49,13 @@ impl MessageHandler for AdminNetcatHandler {
_context: &dyn Context,
) -> MessageHandlerResult {
// Connect to server
let mut stream =
timeout(self.config.timeout, TcpStream::connect(&self.config.tcp_addr))
.await
.map_err(|_| (504u16, "connecting: timeout".into()))?
.map_err(|err| (502u16, format!("connecting: {err}").into()))?;
let mut stream = timeout(
self.config.timeout,
TcpStream::connect(&self.config.tcp_addr),
)
.await
.map_err(|_| (504u16, "connecting: timeout".into()))?
.map_err(|err| (502u16, format!("connecting: {err}").into()))?;
// Write message with CRLF terminator
let message = format!("{}\r\n", msg.message);