Lines Matching refs:cid
283 pub async fn update(cid: u32, value: ContextForward) {
286 map.insert(cid, value.clone());
289 pub async fn remove(cid: u32) {
290 crate::info!("ContextForward remove, cid:{}", cid);
293 let _ = map.remove(&cid);
296 pub async fn get(cid: u32) -> Option<ContextForward> {
299 let task = map.get(&cid);
303 crate::debug!("ContextForward result:is none,cid={:#?}", cid,);
430 let cid = task.context_forward.id;
431 crate::info!("free channel context session_id:{session_id}, channel_id:{channel_id}, cid:{cid}");
435 TcpWriteStreamMap::end(cid).await;
439 TcpWriteStreamMap::end(cid).await;
697 pub async fn on_accept(cid: u32) {
698 let Some(context_forward) = ForwardContextMap::get(cid).await else {
699 crate::error!("daemon_connect _tcp2 get context is none cid={cid}");
721 pub async fn daemon_connect_tcp(cid: u32, port: u32) {
722 let Some(context_forward) = ForwardContextMap::get(cid).await else {
723 crate::error!("daemon connect tcp get context is none cid={cid}");
732 free_context(cid, true).await;
746 recv_tcp_msg(session_tmp, channel_tmp, rd, cid).await;
764 pub async fn recv_tcp_msg(session_id: u32, channel_id: u32, mut rd: SplitReadHalf, cid: u32) {
771 free_context(cid, true).await;
780 cid,
785 free_context(cid, true).await;
795 pub async fn deamon_read_socket_msg(session_id: u32, channel_id: u32, fd: i32, cid: u32) {
806 free_context(cid, true).await;
812 free_context(cid, true).await;
822 cid,
828 pub async fn free_context(cid: u32, notify_remote: bool) {
829 let Some(context_forward) = ForwardContextMap::get(cid).await else {
830 crate::error!("free forward context get cid is none. cid = {cid}");
847 crate::error!("begin to free forward context cid. cid = {cid}");
871 ForwardContextMap::remove(cid).await;
879 let cid = ctx.id;
885 utils::spawn(async move { daemon_connect_tcp(cid, port).await });
902 let cid = ctx.id;
934 on_accept(cid).await;
972 let cid = ctx.id;
990 free_context(cid, true).await;
1000 cid,
1037 let cid = ctx.id;
1072 free_context(cid, true).await;
1082 free_context(cid, true).await;
1092 cid,
1126 cid,
1244 cid: u32,
1251 let mut new_buf = [u32::to_be_bytes(cid).as_slice(), buf_ptr].concat();
1413 let cid = ctx.id;
1422 deamon_read_socket_msg(session, channel, fd_temp, cid).await
1527 let cid = get_cid(_payload);
1530 let Some(context_forward) = ForwardContextMap::get(cid).await else {
1531 crate::error!("forward command dispatch get context is none cid={cid}");