mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: add log::trace statements for message read and write
This commit is contained in:
parent
a30335730b
commit
23e0e0bcd0
1 changed files with 6 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ use std::time::Duration;
|
||||||
use std::io::ErrorKind;
|
use std::io::ErrorKind;
|
||||||
|
|
||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
use log::info;
|
use log::{info, trace};
|
||||||
use native_tls::TlsAcceptor;
|
use native_tls::TlsAcceptor;
|
||||||
use mio::{Events, Poll, Interest, Token};
|
use mio::{Events, Poll, Interest, Token};
|
||||||
use mio::net::TcpListener;
|
use mio::net::TcpListener;
|
||||||
|
|
@ -184,6 +184,8 @@ pub fn run_handshakes_and_read_messages(
|
||||||
poll_token,
|
poll_token,
|
||||||
peer_addr: established_ws.peer_addr
|
peer_addr: established_ws.peer_addr
|
||||||
};
|
};
|
||||||
|
|
||||||
|
trace!("read message");
|
||||||
|
|
||||||
in_message_sender.send((meta, in_message));
|
in_message_sender.send((meta, in_message));
|
||||||
}
|
}
|
||||||
|
|
@ -241,7 +243,9 @@ pub fn send_out_messages(
|
||||||
use ::tungstenite::Error::Io;
|
use ::tungstenite::Error::Io;
|
||||||
|
|
||||||
match established_ws.ws.write_message(out_message.to_ws_message()){
|
match established_ws.ws.write_message(out_message.to_ws_message()){
|
||||||
Ok(()) => {},
|
Ok(()) => {
|
||||||
|
trace!("sent message");
|
||||||
|
},
|
||||||
Err(Io(err)) if err.kind() == ErrorKind::WouldBlock => {},
|
Err(Io(err)) if err.kind() == ErrorKind::WouldBlock => {},
|
||||||
Err(tungstenite::Error::ConnectionClosed) => {
|
Err(tungstenite::Error::ConnectionClosed) => {
|
||||||
remove_connection_if_exists(connections, meta.poll_token);
|
remove_connection_if_exists(connections, meta.poll_token);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue