Struct utils_box::tcp_client::TcpClient
source · pub struct TcpClient { /* private fields */ }
Implementations§
source§impl TcpClient
impl TcpClient
sourcepub fn new(server_ip: String, server_port: u16) -> Result<Self>
pub fn new(server_ip: String, server_port: u16) -> Result<Self>
Create a new TCP connection to the specified server and connect to it
sourcepub fn server_info(&self) -> (String, u16)
pub fn server_info(&self) -> (String, u16)
Get the server IP and port information
pub fn send(&mut self, data: &[u8]) -> Result<()>
pub fn receive(&mut self) -> Result<Vec<u8>>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for TcpClient
impl Send for TcpClient
impl Sync for TcpClient
impl Unpin for TcpClient
impl UnwindSafe for TcpClient
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