Struct tokio_kcp::KcpListener
source · pub struct KcpListener { /* private fields */ }
Implementations§
source§impl KcpListener
impl KcpListener
sourcepub async fn bind<A: ToSocketAddrs>(
config: KcpConfig,
addr: A
) -> KcpResult<KcpListener>
pub async fn bind<A: ToSocketAddrs>( config: KcpConfig, addr: A ) -> KcpResult<KcpListener>
Create an KcpListener
bound to addr
sourcepub async fn from_socket(
config: KcpConfig,
udp: UdpSocket
) -> KcpResult<KcpListener>
pub async fn from_socket( config: KcpConfig, udp: UdpSocket ) -> KcpResult<KcpListener>
Create a KcpListener
from an existed UdpSocket
sourcepub async fn accept(&mut self) -> KcpResult<(KcpStream, SocketAddr)>
pub async fn accept(&mut self) -> KcpResult<(KcpStream, SocketAddr)>
Accept a new connected KcpStream
pub fn poll_accept( &mut self, cx: &mut Context<'_> ) -> Poll<KcpResult<(KcpStream, SocketAddr)>>
sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Get the local address of the underlying socket
Trait Implementations§
source§impl AsRawFd for KcpListener
impl AsRawFd for KcpListener
source§impl Debug for KcpListener
impl Debug for KcpListener
Auto Trait Implementations§
impl Freeze for KcpListener
impl !RefUnwindSafe for KcpListener
impl Send for KcpListener
impl Sync for KcpListener
impl Unpin for KcpListener
impl !UnwindSafe for KcpListener
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more