[−][src]Struct kcpclient::kcp_client::client::KcpClient
KCP 客户端
Implementations
impl KcpClient
[src]
pub fn connect<A: ToSocketAddrs>(
addr: A,
config: KcpConfig
) -> Result<KcpClient, Box<dyn Error>>
[src]
addr: A,
config: KcpConfig
) -> Result<KcpClient, Box<dyn Error>>
连接
pub fn init_conv(&self) -> Result<u32, Box<dyn Error>>
[src]
从远程服务器获取并设置conv 发送4字节令牌,收到8字节 4字节令牌+4字节CONV
pub fn set_conv(&self, conv: u32) -> Result<(), Box<dyn Error>>
[src]
手动设置conv
pub fn check_conv(&self) -> bool
[src]
检查conv是否设置如果0 就是没有设置返回false
pub fn recv(&self) -> Result<Bytes, Box<dyn Error>>
[src]
读取数据包
pub fn update(&self) -> Result<(), Box<dyn Error>>
[src]
更新
pub fn send(&self, data: &[u8]) -> Result<usize, Box<dyn Error>>
[src]
发送
Auto Trait Implementations
impl RefUnwindSafe for KcpClient
impl Send for KcpClient
impl Sync for KcpClient
impl Unpin for KcpClient
impl UnwindSafe for KcpClient
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>,