removed ping handling

This commit is contained in:
Nickiel12 2024-07-19 20:20:03 -07:00
parent b1789e8293
commit 293a550d3b
2 changed files with 9 additions and 8 deletions

View file

@ -239,9 +239,13 @@ async fn socket_listen(
while let Some(msg) = reader.next().await {
match msg {
Ok(val) => {
if let Err(e) = mec.send(ApplicationEvent::SocketMessage(val)).await {
error!("There was an error sending to Main Event Channel, closing socket recv thread: {e}");
break;
match val {
Message::Ping(_) => {
// Do nothing because pings are handled on reads and write by tungestenite
}
_ => {
info!("Received message from the camera websocket? {:#?}", val);
}
}
}
Err(e) => {

View file

@ -147,11 +147,8 @@ async fn handle_message(
// this was not the expected response, recursion!
return handle_message(recvr, sender, to_mec, last_iter).await;
}
Message::Ping(content) => {
if let Err(e) = sender.send(Message::Pong(content)).await {
error!("Video processor could not send message to MEC, exiting: {e}");
return false;
}
Message::Ping(_) => {
// Ping/Pongs are handled by tokio tungstenite on reads and writes
// this was not the expected response, recursion!
return handle_message(recvr, sender, to_mec, last_iter).await;
}