Seastar
High performance C++ framework for concurrent servers
Classes | Functions
Networking

Classes

class  seastar::connected_socket
 
class  seastar::socket
 
class  seastar::server_socket
 A listening socket, waiting to accept incoming network connections. More...
 

Functions

server_socket seastar::listen (socket_address sa)
 
server_socket seastar::listen (socket_address sa, listen_options opts)
 
future< connected_socketseastar::connect (socket_address sa)
 
future< connected_socketseastar::connect (socket_address sa, socket_address local, transport proto=transport::TCP)
 

Detailed Description

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.

Function Documentation

◆ connect() [1/2]

future< connected_socket > seastar::connect ( socket_address  sa)

Establishes a connection to a given address

Attempts to connect to the given address.

Parameters
sasocket address to connect to
Returns
a connected_socket object, or an exception

◆ connect() [2/2]

future< connected_socket > seastar::connect ( socket_address  sa,
socket_address  local,
transport  proto 
)

Establishes a connection to a given address

Attempts to connect to the given address with a defined local endpoint

Parameters
sasocket address to connect to
localsocket address for local endpoint
prototransport protocol (TCP or SCTP)
Returns
a connected_socket object, or an exception

◆ listen() [1/2]

server_socket seastar::listen ( socket_address  sa)

Listen for connections on a given port

Starts listening on a given address for incoming connections.

Parameters
sasocket address to listen on
Returns
server_socket object ready to accept connections.
See also
listen(socket_address sa, listen_options opts)

◆ listen() [2/2]

server_socket seastar::listen ( socket_address  sa,
listen_options  opts 
)

Listen for connections on a given port

Starts listening on a given address for incoming connections.

Parameters
sasocket address to listen on
optsoptions controlling the listen operation
Returns
server_socket object ready to accept connections.
See also
listen(socket_address sa)