Struct photonio_uring::net::TcpStream
source · pub struct TcpStream(_);
Expand description
A TCP stream between a local and a remote socket.
This type is an async version of std::net::TcpStream
.
Implementations
sourceimpl TcpStream
impl TcpStream
sourcepub async fn connect(addr: SocketAddr) -> Result<Self>
pub async fn connect(addr: SocketAddr) -> Result<Self>
Opens a TCP connection to a remote host.
See also std::net::TcpStream::connect
.
sourcepub async fn shutdown(&self, how: Shutdown) -> Result<()>
pub async fn shutdown(&self, how: Shutdown) -> Result<()>
Shuts down the read, write, or both halves of this connection.
See also std::net::TcpStream::shutdown
.
sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the socket address of the local half of this connection.
See also std::net::TcpStream::local_addr
.
sourcepub fn peer_addr(&self) -> Result<SocketAddr>
pub fn peer_addr(&self) -> Result<SocketAddr>
Returns the socket address of the remote peer of this connection.
See also std::net::TcpStream::peer_addr
.
sourcepub fn ttl(&self) -> Result<u32>
pub fn ttl(&self) -> Result<u32>
Gets the value of the IP_TTL
option on this socket.
See also std::net::TcpStream::ttl
.
sourcepub fn set_ttl(&self, ttl: u32) -> Result<()>
pub fn set_ttl(&self, ttl: u32) -> Result<()>
Sets the value of the IP_TTL
option on this socket.
See also std::net::TcpStream::set_ttl
.
sourcepub fn nodelay(&self) -> Result<bool>
pub fn nodelay(&self) -> Result<bool>
Gets the value of the TCP_NODELAY
option on this socket.
See also std::net::TcpStream::nodelay
.
sourcepub fn set_nodelay(&self, nodelay: bool) -> Result<()>
pub fn set_nodelay(&self, nodelay: bool) -> Result<()>
Sets the value of the TCP_NODELAY
option on this socket.
See also std::net::TcpStream::set_nodelay
.
Trait Implementations
sourceimpl AsFd for TcpStream
impl AsFd for TcpStream
sourcefn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
sourceimpl FromRawFd for TcpStream
impl FromRawFd for TcpStream
sourceunsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Self
from the given raw file
descriptor. Read more