Skip to main content

Module tcp_socket

Module tcp_socket 

Source

Re-exportsยง

use std::cell::Cell; ๐Ÿ”’
use std::cell::RefCell; ๐Ÿ”’
use std::cell::RefMut; ๐Ÿ”’
use std::io::Read; ๐Ÿ”’
use std::io::Write; ๐Ÿ”’
use std::net::Ipv4Addr; ๐Ÿ”’
use std::net::Ipv6Addr; ๐Ÿ”’
use std::net::Shutdown; ๐Ÿ”’
use std::net::SocketAddr; ๐Ÿ”’
use std::net::SocketAddrV4; ๐Ÿ”’
use std::net::SocketAddrV6; ๐Ÿ”’
use std::sync::atomic::AtomicBool; ๐Ÿ”’
use std::time::Duration; ๐Ÿ”’
use std::io; ๐Ÿ”’
use std::mem; ๐Ÿ”’
use mio::event::Source; ๐Ÿ”’
use mio::net::TcpListener; ๐Ÿ”’
use mio::net::TcpStream; ๐Ÿ”’
use rustc_const_eval::interpret::InterpResult; ๐Ÿ”’
use rustc_const_eval::interpret::interp_ok; ๐Ÿ”’
use rustc_middle::throw_unsup_format; ๐Ÿ”’
use rustc_target::spec::Os; ๐Ÿ”’
use crate::shims::files::EvalContextExt as _; ๐Ÿ”’
use crate::shims::files::FdNum; ๐Ÿ”’
use crate::shims::files::FileDescription; ๐Ÿ”’
use crate::shims::files::FileDescriptionRef; ๐Ÿ”’
use crate::shims::unix::UnixFileDescription; ๐Ÿ”’
use crate::shims::unix::socket::EvalContextExt; ๐Ÿ”’
use crate::shims::unix::socket::UnixSocketFileDescription; ๐Ÿ”’
use crate::*; ๐Ÿ”’

Structsยง

TcpSocket ๐Ÿ”’

Enumsยง

SocketState ๐Ÿ”’

Constantsยง

INITIAL_TCP_SOCKET_READINESS ๐Ÿ”’
On Linux a TCP socket is initally in the TCP_CLOSE state: See https://github.com/torvalds/linux/blob/cee9395/net/core/sock.c#L3753 For a socket in this state, (E)POLLHUP is reported: See https://github.com/torvalds/linux/blob/980a813/net/ipv4/tcp.c#L581-L582 Additionally, because the write buffer is initially empty and the socket is not shut down, (E)POLLOUT is also reported for freshly created TCP sockets: See https://github.com/torvalds/linux/blob/980a813/net/ipv4/tcp.c#L602

Traitsยง

EvalContextPrivExt ๐Ÿ”’