Seastar provides a simple networking API, backed by two TCP/IP stacks: the POSIX stack, utilizing the kernel's BSD socket APIs, and the native stack, implement fully within seastar and able to drive network cards directly. The native stack supports zero-copy on both transmit and receive, and is implemented using seastar's high performance, lockless sharded design. The network stack can be selected with the --network-stack
command-line parameter.
◆ seastar::connected_socket_input_stream_config
struct seastar::connected_socket_input_stream_config |
Class Members |
unsigned |
buffer_size |
Initial buffer size to use for input buffering. |
unsigned |
max_buffer_size |
Maximum buffer size to use for input buffering. The system will increase buffer sizes if it sees a tendency towards large requests, but will not go above this buffer size.
|
unsigned |
min_buffer_size |
Minimum buffer size to use for input buffering. The system will decrease buffer sizes if it sees a tendency towards small requests, but will not go below this buffer size.
|
◆ seastar::session_dn
struct seastar::session_dn |
Class Members |
sstring |
issuer |
|
sstring |
subject |
|
◆ seastar::accept_result
struct seastar::accept_result |
◆ connect() [1/2]
Establishes a connection to a given address
Attempts to connect to the given address.
- Parameters
-
sa | socket address to connect to |
- Returns
- a connected_socket object, or an exception
◆ connect() [2/2]
Establishes a connection to a given address
Attempts to connect to the given address with a defined local endpoint
- Parameters
-
sa | socket address to connect to |
local | socket address for local endpoint |
proto | transport protocol (TCP or SCTP) |
- Returns
- a connected_socket object, or an exception
◆ listen() [1/2]
◆ listen() [2/2]
Listen for connections on a given port
Starts listening on a given address for incoming connections.
- Parameters
-
sa | socket address to listen on |
opts | options controlling the listen operation |
- Returns
- server_socket object ready to accept connections.
- See also
- listen(socket_address sa)
◆ make_bound_datagram_channel()
Creates a datagram_channel object suitable for sending and receiving datagrams to/from destinations that belong to the provided address family. Supported address families: AF_INET, AF_INET6 and AF_UNIX.
- Parameters
-
local | local address to bind to |
- Returns
- a net::datagram_channel object for sending/receiving datagrams in a specified address family.
◆ make_socket()
socket seastar::make_socket |
( |
| ) |
|
Creates a socket object suitable for establishing stream-oriented connections
- Returns
- a socket object that can be used for establishing connections
◆ make_udp_channel() [1/2]
Creates a udp_channel object suitable for sending UDP packets
The channel is not bound to a local address, and thus can only be used for sending.
- Returns
- a net::udp_channel object that can be used for UDP transfers.
◆ make_udp_channel() [2/2]
Creates a udp_channel object suitable for sending and receiving UDP packets
- Parameters
-
local | local address to bind to |
- Returns
- a net::udp_channel object that can be used for UDP transfers.
◆ make_unbound_datagram_channel()
Creates a datagram_channel object suitable for sending datagrams to destinations that belong to the provided address family. Supported address families: AF_INET, AF_INET6 and AF_UNIX.
Setting family to AF_INET or AF_INET6 creates a datagram_channel that uses UDP protocol. AF_UNIX creates a datagram_channel that uses UNIX domain sockets.
The channel is not bound to a local address, and thus can only be used for sending.
- Parameters
-
family | address family in which the datagram_channel will operate |
- Returns
- a net::datagram_channel object for sending datagrams in a specified address family.