Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::connected_socket Class Reference

Detailed Description

A TCP (or other stream-based protocol) connection.

A connected_socket represents a full-duplex stream between two endpoints, a local endpoint and a remote endpoint.

#include <api.hh>

Public Member Functions

 connected_socket ()
 Constructs a connected_socket not corresponding to a connection.
 
 connected_socket (connected_socket &&cs) noexcept
 Moves a connected_socket object.
 
connected_socketoperator= (connected_socket &&cs) noexcept
 Move-assigns a connected_socket object.
 
input_stream< char > input ()
 
output_stream< char > output (size_t buffer_size=8192)
 
void set_nodelay (bool nodelay)
 Sets the TCP_NODELAY option (disabling Nagle's algorithm)
 
bool get_nodelay () const
 
void set_keepalive (bool keepalive)
 Sets SO_KEEPALIVE option (enable keepalive timer on a socket)
 
bool get_keepalive () const
 
void set_keepalive_parameters (const net::keepalive_params &p)
 Sets TCP keepalive parameters.
 
net::keepalive_params get_keepalive_parameters () const
 Get TCP keepalive parameters.
 
void shutdown_output ()
 
void shutdown_input ()
 

Member Function Documentation

◆ get_keepalive()

bool seastar::connected_socket::get_keepalive ( ) const

Gets O_KEEPALIVE option

Returns
whether the keepalive option is enabled or not

◆ get_nodelay()

bool seastar::connected_socket::get_nodelay ( ) const

Gets the TCP_NODELAY option (Nagle's algorithm)

Returns
whether the nodelay option is enabled or not

◆ input()

input_stream< char > seastar::connected_socket::input ( )

Gets the input stream.

Gets an object returning data sent from the remote endpoint.

◆ output()

output_stream< char > seastar::connected_socket::output ( size_t  buffer_size = 8192)

Gets the output stream.

Gets an object that sends data to the remote endpoint.

Parameters
buffer_sizehow much data to buffer

◆ shutdown_input()

void seastar::connected_socket::shutdown_input ( )

Disables input from the socket.

Current or future reads will immediately fail with an error. This is useful to abort operations on a socket that is not making progress due to a peer failure.

◆ shutdown_output()

void seastar::connected_socket::shutdown_output ( )

Disables output to the socket.

Current or future writes that have not been successfully flushed will immediately fail with an error. This is useful to abort operations on a socket that is not making progress due to a peer failure.


The documentation for this class was generated from the following files: