[−][src]Struct kcpserver::KcpPeer
KCP Peer UDP的包进入 KCP PEER 经过KCP 处理后 输出 输入的包 进入KCP PEER处理,然后 输出到UDP PEER SEND TO 同时还需要一个UPDATE 线程 去10MS 一次的运行KCP UPDATE token 用于扩赞逻辑上下文
Fields
kcp: KcpLock
conv: u32
addr: SocketAddr
token: RefCell<TokenStore<T>>
last_rev_time: AtomicI64
next_update_time: AtomicU32
disconnect_event: RefCell<Option<Box<dyn FnOnce(u32)>>>
Implementations
impl<T: Send> KcpPeer<T>
[src]
简化KCP PEER 函数
pub fn disconnect(&self)
[src]
pub async fn send<'_, '_>(&'_ self, buf: &'_ [u8]) -> KcpResult<usize>
[src]
pub async fn flush<'_>(&'_ self) -> KcpResult<()>
[src]
pub async fn flush_async<'_>(&'_ self) -> KcpResult<()>
[src]
pub fn get_main_tx(&self) -> Sender<RecvType>
[src]
Trait Implementations
impl<T: Send> Drop for KcpPeer<T>
[src]
impl<T: Send> Send for KcpPeer<T>
[src]
impl<T: Send> Sync for KcpPeer<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for KcpPeer<T>
impl<T> Unpin for KcpPeer<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for KcpPeer<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,