A Socket
struct Socket {
/* private fields */
}| Name | Description |
|---|---|
| ipv4_datagram | Creates an Ipv4/Udp socket. |
| ipv4_raw | Creates a raw Ipv4 socket. |
| ipv4_stream | Creates an Ipv4/Tcp socket. |
| ipv6_datagram | Creates an Ipv6/Udp socket. |
| ipv6_raw | Creates a raw Ipv6 socket. |
| ipv6_stream | Creates an Ipv6/Tcp socket. |
| netlink | Creates a new Netlink socket. |
| new | Creates a new socket. |
| unix_datagram | Creates a Unix/Udp socket. |
| unix_seqpacket | Creates a Unix/SeqPacket socket. |
| unix_stream | Creates a Unix/Tcp socket. |
| Receiver | Name | Description |
|---|---|---|
&self | accept | Accepts a new connection on the socket. |
&self | accept_addr | Accepts a new connection on the socket and returns the peer's address. |
&self | accepts_connections | Retrieves whether this socket has been set up to accept connections. |
&self | bind | Binds the socket to an address. |
&self | bind_to_device | Binds this socket to a device so that only packets from this device will be accepted. |
&self | connect | Connects this socket to a peer. |
&self | device | Retrieves the name of the device this socket is bound to, if any. The buffer in which the device name will be stored. |
&self | disconnect | Disconnects a connected, connection-less socket. |
&self | domain | Retrieves the domain of this socket. |
&self | error | Retrieves the last pending socket error. |
&self | force_set_recv_buffer_size | Sets the maximal receive buffer size of this socket, overriding normal system limits. |
&self | force_set_send_buffer_size | Sets the maximal send buffer size of this socket, overriding normal system limits. |
&self | gather_send | Gathers a message from multiple sources and sends it on a connected socket. |
&self | gather_send_to | Gathers a message from multiple sources and sends it on a connection-less socket. |
&self | get_addr | Retrieves the address the socket is bound to. |
&self | get_peer_addr | Retrieves the address of the peer this socket is connected to, if any. |
&self | ipv4_add_multicast_source | Sets the socket up to accept multicast messages from a particular source. |
&self | ipv4_block_multicast_peer | Blocks messages from a peer in a multicast group. |
&self | ipv4_hop_limit | Retrieves the hop limit of Ipv4 packets sent over this socket. |
&self | ipv4_is_header_included | Retrieves whether packets sent over this socket already have a header included. |
&self | ipv4_is_multicast_all | Retrieves whether this socket receives all messages sent to any multicast groups that any socket on this system is a member of.
|
&self | ipv4_is_multicast_loop | Retrieves whether multicast packets sent from this socket are looped back to local sockets. |
&self | ipv4_is_receive_options | Retrieves whether all received messages are accompanied by an options control message. |
&self | ipv4_is_receive_raw_options | Retrieves whether all received messages are accompanied by an options control message. |
&self | ipv4_join_multicast_group | Joins a multicast group. |
&self | ipv4_leave_multicast_group | Leaves a multicast group. |
&self | ipv4_mtu | Retrieves the MTU of this socket. |
&self | ipv4_multicast_hop_limit | Retrieves the hop limit of Ipv4 multicast packets sent over this socket. |
&self | ipv4_options | Retrieves the Ipv4 options sent with each packet sent over this socket. |
&self | ipv4_remove_multicast_source | Removes a previously added source of multicast messages. |
&self | ipv4_set_header_included | Sets whether packets sent over this socket already have a header included. |
&self | ipv4_set_hop_limit | Sets the hop limit of Ipv4 packets sent over this socket. |
&self | ipv4_set_multicast_all | Sets whether this socket receives all messages sent to any multicast groups that any socket on this system is a member of. |
&self | ipv4_set_multicast_hop_limit | Sets the hop limit of Ipv4 multicast packets sent over this socket. |
&self | ipv4_set_multicast_loop | Sets whether multicast packets sent from this socket are looped back to local sockets. |
&self | ipv4_set_options | Sets the Ipv4 options sent with each packet sent over this socket. |
&self | ipv4_set_receive_options | Sets whether all received messages are accompanied by an options control message. |
&self | ipv4_set_receive_raw_options | Sets whether all received messages are accompanied by an options control message. |
&self | ipv4_unblock_multicast_peer | Unblocks messages from a peer in a multicast group. |
&self | ipv6_hop_limit | Retrieves the hop limit of packets sent over this socket. |
&self | ipv6_into_ipv4 | Turns an Ipv6 socket into an Ipv4 socket. |
&self | ipv6_is_ipv6_only | Retrieves whether this socket only handles Ipv6 packets. |
&self | ipv6_is_multicast_loop | Retrieves whether multicast packets sent from this socket are looped back to local sockets. |
&self | ipv6_join_multicast_group | Joins a multicast group. |
&self | ipv6_leave_multicast_group | Leaves a multicast group. |
&self | ipv6_mtu | Retrieves the MTU of this socket. |
&self | ipv6_multicast_hop_limit | Retrieves the hop limit of multicast packets sent over this socket. |
&self | ipv6_set_hop_limit | Sets the hop limit of packets sent over this socket. |
&self | ipv6_set_ipv6_only | Sets whether this socket only handles Ipv6 packets. |
&self | ipv6_set_mtu | Sets the MTU of this socket. |
&self | ipv6_set_multicast_hop_limit | Sets the hop limit of multicast packets sent over this socket. |
&self | ipv6_set_multicast_loop | Sets whether multicast packets sent from this socket are looped back to local sockets. |
&self | is_broadcast | Retrieves whether this socket allows broadcasting. |
&self | is_debug | Retrieves whether this socket is in debug mode. |
&self | is_dont_route | Retrieves whether this socket only sends packets to directly connected hosts. |
&self | is_keep_alive | Retrieves whether this socket sends keep-alive messages. |
&self | is_oob_inline | Retrieves whether this socket places out-of-band data directly into the data stream. |
&self | is_receive_credentials | Retrieves whether this socket accepts credentials control messages. |
&self | is_reuse_addr | |
&self | is_reuse_port | |
&self | is_timestamp | Retrieves whether this socket sends timestamp control messages. |
&self | kind | Retrieves the kind of the socket. |
&self | last_packet | Retrieves the time the last packet was received. |
&self | linger | Retrieves the linger setting of this socket. |
&self | listen | Marks this socket as accepting incoming connections. |
&self | mark | Retrieves the mark of the packets sent over this socket. |
&self | peek_offset | Retrieves the peek offset of this socket. |
&self | peer_credentials | Retrieves the credentials of a connected peer. |
&self | pending_input | Retrieves the amount of available data. |
&self | pending_output | Retrieves the amount of data not yet successfully sent. |
&self | priority | Retrieves the priority of packets sent over this socket. |
&self | protocol | Retrieves the protocol of this socket. |
&self | recv | Receives a message on a connected socket. |
&self | recv_buffer_size | Retrieves the maximal receive buffer size of this socket. |
&self | recv_from | Receives a message on a connection-less socket. |
&self | recv_msg | Receives a message, control messages, and the senders address. |
&self | recv_timeout | Retrieves the timeout option of receiving operations. |
&self | scatter_recv | Receives a message on a connected socket and stores it in multiple buffers. |
&self | send | Sends a message over a connected socket. |
&self | send_buffer_size | Retrieves the maximal send buffer size of this socket. |
&self | send_ctrl | Gathers a message from multiple source and sends it together with a control message on a connected socket. |
&self | send_ctrl_to | Gathers a message from multiple source and sends it together with a control message on a connection-less socket. |
&self | send_timeout | Retrieves the timeout option of sending operations. |
&self | send_to | Sends a message on a connection-less socket. |
&self | set_broadcast | Enables or disables broadcasting for this socket. |
&self | set_debug | Enables or disables debug mode for this socket. |
&self | set_dont_route | Sets whether this socket only sends packets to directly connected hosts. |
&self | set_keep_alive | Sets whether this socket sends keep-alive messages. |
&self | set_linger | Sets the linger setting of this socket. |
&self | set_mark | Sets the mark of the packets sent over this socket. |
&self | set_oob_inline | Sets whether this socket places out-of-band data directly into the data stream. |
&self | set_peek_offset | Sets the peek offset of this socket. |
&self | set_priority | Sets the priority of packets sent over this socket. |
&self | set_receive_credentials | Sets whether this socket accepts credentials control messages. |
&self | set_recv_buffer_size | Sets the maximal receive buffer size of this socket. |
&self | set_recv_timeout | Sets the timeout option of receiving operations. |
&self | set_reuse_addr | |
&self | set_reuse_port | |
&self | set_send_buffer_size | Sets the maximal send buffer size of this socket. |
&self | set_send_timeout | Sets the timeout option of sending operations. |
&self | set_timestamp | Sets whether this socket sends timestamp control messages. |
&self | shutdown | Shuts down the receiving and sending ends of a connected socket. |
&self | shutdown_incoming | Shuts down the receiving end of a connected socket. |
&self | shutdown_outgoing | Shuts down the sending end of a socket. |
&self | tcp_is_cork | Retrieves the status of the |
&self | tcp_set_cork | Sets the status of the |
&self | udp_is_cork | Retrieves the status of the |
&self | udp_set_cork | Sets the status of the |
| Name | Description |
|---|---|
| Drop | Objects with a destructor. |
| FDContainer | Objects that are file descriptor wrappers. |
| UndefState | Types that are not valid when they contain certain bit patterns. |
This type provides access to the Linux socket interface.