1
This commit is contained in:
parent
b5fb7cb0e8
commit
58fa1b92e5
@ -6,7 +6,7 @@ use crate::common::types::DownStreamPack;
|
|||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
|
|
||||||
pub struct UserApp {
|
pub struct UserApp {
|
||||||
net_msg_queue: Arc::<std::sync::Mutex::<r9::QueueLock<DownStreamPack>>>,
|
down_stream_msg_queue: Arc::<std::sync::Mutex::<r9::QueueLock<DownStreamPack>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl f9::app::UserApp for UserApp {
|
impl f9::app::UserApp for UserApp {
|
||||||
@ -66,20 +66,20 @@ impl UserApp {
|
|||||||
}
|
}
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let p = UserApp{
|
let p = UserApp{
|
||||||
net_msg_queue: r9::QueueLock::<DownStreamPack>::new(),
|
down_stream_msg_queue: r9::QueueLock::<DownStreamPack>::new(),
|
||||||
};
|
};
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fetch_work_list(&self) -> Arc::<Mutex::<r9::ListHeadLock<DownStreamPack>>> {
|
fn fetch_work_list(&self) -> Arc::<Mutex::<r9::ListHeadLock<DownStreamPack>>> {
|
||||||
self.net_msg_queue.lock().unwrap().fetch();
|
self.down_stream_msg_queue.lock().unwrap().fetch();
|
||||||
return self.net_msg_queue.lock().unwrap().work_list.lock().unwrap().clone();
|
return self.down_stream_msg_queue.lock().unwrap().work_list.lock().unwrap().clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_down_stream_pack(&self, socket_handle: u16, data: bytes::BytesMut) {
|
pub fn add_down_stream_pack(&self, socket_handle: u16, data: bytes::BytesMut) {
|
||||||
println!("add_down_stream_pack1 len:{0}", data.len());
|
println!("add_down_stream_pack1 len:{0}", data.len());
|
||||||
let node = DownStreamPack::new(socket_handle, data);
|
let node = DownStreamPack::new(socket_handle, data);
|
||||||
self.net_msg_queue.lock().unwrap().push(&node.lock().unwrap().entry);
|
self.down_stream_msg_queue.lock().unwrap().push(&node.lock().unwrap().entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user