Lines Matching defs:socket
3 //! [Further reading](https://man7.org/linux/man-pages/man7/socket.7.html)
63 pub use crate::sys::socket::addr::alg::AlgAddr;
65 pub use crate::sys::socket::addr::netlink::NetlinkAddr;
68 pub use crate::sys::socket::addr::sys_control::SysControlAddr;
70 pub use crate::sys::socket::addr::vsock::VsockAddr;
83 use crate::sys::socket::addr::{ipv4addr_to_libc, ipv6addr_to_libc};
86 /// when creating a socket with [`socket()`](fn.socket.html)
129 /// Constants used in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html)
157 /// Reserved for user-mode socket protocols
226 // The protocol number is fed into the socket syscall in network byte order.
255 /// Additional socket options
257 /// Set non-blocking mode on the new socket
337 /// the socket error queue. (For more details, see
488 /// Return type of [`LocalPeerCred`](crate::sys::socket::sockopt::LocalPeerCred)
515 /// Request for multicast socket operations
540 /// Request for ipv6 multicast socket operations
591 $crate::sys::socket::CMSG_SPACE(::std::mem::size_of::<$x>() as $crate::sys::socket::c_uint)
686 /// # use nix::sys::socket::*;
694 /// let in_socket = socket(
729 /// // Close socket
803 /// `UdpGroSegment` socket option should be enabled on a socket
813 /// socket between the last recieved packet and this
816 /// `RxqOvfl` socket option should be enabled on a socket
1042 /// a process connected to the socket.
1044 /// This is similar to the socket option `SO_PEERCRED`, but requires a
1055 /// a process connected to the socket.
1057 /// This is similar to the socket options `LOCAL_CREDS` and `LOCAL_PEERCRED`, but
1157 /// socket between the last recieved packet and this
1437 /// Send data in scatter-gather vectors to a socket, possibly accompanied
1446 /// # use nix::sys::socket::*;
1461 /// # use nix::sys::socket::*;
1466 /// let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(),
1494 /// messages on a socket using a single system call. This has performance
1648 /// An extension of recvmsg that allows the caller to receive multiple messages from a socket using a single system call.
1666 /// overwritten in the meantime by an unrelated network event on a socket, for example an
1819 use crate::sys::socket::{AddressFamily, ControlMessageOwned};
1826 use crate::sys::socket::{
1827 sendmsg, setsockopt, socket, sockopt::Timestamping, MsgFlags, SockFlag, SockType,
1834 let ssock = socket(
1841 let rsock = socket(
1848 crate::sys::socket::bind(rsock, &sock_addr)?;
1871 let cmsg = cmsg_space!(crate::sys::socket::Timestamps);
2033 /// Receive message in scatter-gather vectors from a socket, and
2073 /// socket. Normally only a single protocol exists to support a
2074 /// particular socket type within a given protocol family, in which case
2079 /// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html)
2080 pub fn socket<T: Into<Option<SockProtocol>>>(
2097 let res = unsafe { libc::socket(domain as c_int, ty, protocol) };
2132 /// Listen for connections on a socket
2141 /// Bind a name to a socket
2150 /// Accept a connection on a socket
2159 /// Accept a connection on a socket
2188 /// Initiate a connection on a socket
2197 /// Receive data from a connection-oriented socket. Returns the number of
2214 /// Receive data from a connectionless or connection-oriented socket. Returns
2215 /// the number of bytes read and, for connectionless sockets, the socket
2246 /// Send a message to a socket
2269 /// Send data to a connection-oriented socket. Returns the number of bytes read
2291 /// Represents a socket option that can be retrieved.
2295 /// Look up the value of this socket option on the given socket.
2299 /// Represents a socket option that can be set.
2303 /// Set the value of this socket option on the given socket.
2307 /// Get the current value for the requested socket option
2314 /// Sets the value for the requested socket option
2321 /// use nix::sys::socket::setsockopt;
2322 /// use nix::sys::socket::sockopt::KeepAlive;
2339 /// Get the address of the peer connected to the socket `fd`.
2359 /// Get the current address to which the socket `fd` is bound.