pub struct TcpSocket { /* private fields */ }Implementations§
Source§impl TcpSocket
TcpSocket API Implementation
the default socket implementation is aynchronous socket, do not require the app to set non-blocking mode
impl TcpSocket
TcpSocket API Implementation the default socket implementation is aynchronous socket, do not require the app to set non-blocking mode
pub fn new(local_addr: &SocketAddr) -> Result<Self, RESULT>
pub fn get_socket_by_id(id: i32) -> Self
pub fn set_send_buf_size(&mut self, buf_size: usize) -> RESULT
pub fn set_recv_buf_size(&mut self, buf_size: usize) -> RESULT
pub fn connect(&mut self, dst: &SocketAddr) -> RESULT
pub fn send(&mut self, buf: &[u8]) -> Result<usize, RESULT>
pub fn recv(&mut self, buf: &mut [u8]) -> Result<usize, RESULT>
pub fn get_socket_id(&self) -> i32
Sourcepub fn get_os_socket(&self) -> RawFdType
pub fn get_os_socket(&self) -> RawFdType
get underlying os raw socket id
pub fn get_local_addr(&self) -> Option<SocketAddr>
pub fn get_peer_addr(&self) -> Option<SocketAddr>
pub fn close(&mut self) -> RESULT
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TcpSocket
impl RefUnwindSafe for TcpSocket
impl Send for TcpSocket
impl Sync for TcpSocket
impl Unpin for TcpSocket
impl UnwindSafe for TcpSocket
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