More debugging to remote server...
This commit is contained in:
parent
93403d781b
commit
351e301293
2 changed files with 15 additions and 10 deletions
|
|
@ -6,6 +6,8 @@ use tokio::{
|
||||||
net::TcpStream,
|
net::TcpStream,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
use crate::frame::{self, ClientFrames, ServerFrames};
|
use crate::frame::{self, ClientFrames, ServerFrames};
|
||||||
|
|
||||||
pub(crate) enum ConnectionType {
|
pub(crate) enum ConnectionType {
|
||||||
|
|
@ -34,8 +36,11 @@ impl Connection {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn read_frame(&mut self) -> crate::Result<Option<ClientFrames>> {
|
pub async fn read_frame(&mut self) -> crate::Result<Option<ClientFrames>> {
|
||||||
|
info!("Start read_frame");
|
||||||
loop {
|
loop {
|
||||||
|
info!("Looping to self.parse_frame");
|
||||||
if let Some(frame) = self.parse_frame()? {
|
if let Some(frame) = self.parse_frame()? {
|
||||||
|
info!("parse_frame got a result: {frame:?}");
|
||||||
return Ok(Some(frame));
|
return Ok(Some(frame));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ impl Handler {
|
||||||
while !self.shutdown.is_shutdown() {
|
while !self.shutdown.is_shutdown() {
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
res = self.connection.read_frame() => {
|
res = self.connection.read_frame() => {
|
||||||
|
info!("Reading from frame: {res:?}");
|
||||||
match res? {
|
match res? {
|
||||||
Some(frame) => {
|
Some(frame) => {
|
||||||
info!("Received frame");
|
info!("Received frame");
|
||||||
|
|
@ -142,17 +143,16 @@ impl Handler {
|
||||||
},
|
},
|
||||||
None => return Ok(()),
|
None => return Ok(()),
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// message = receive_message.recv() => {
|
message = receive_message.recv() => {
|
||||||
// info!("Received a message through the channel");
|
info!("Reading from channel: {message:?}");
|
||||||
// match message {
|
match message {
|
||||||
// Some(message) => {
|
Some(message) => {
|
||||||
// let _ = self.connection.write_frame(message).await;
|
let _ = self.connection.write_frame(message).await;
|
||||||
// },
|
},
|
||||||
// None => (),
|
None => (),
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
_ = self.shutdown.recv() => {
|
_ = self.shutdown.recv() => {
|
||||||
debug!("Shutdown");
|
debug!("Shutdown");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue