Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
seastar::rpc::protocol< Serializer, MsgType >::client Class Reference

Detailed Description

template<typename Serializer, typename MsgType = uint32_t>
class seastar::rpc::protocol< Serializer, MsgType >::client

Represents a client side connection.

#include <seastar/rpc/rpc.hh>

Inheritance diagram for seastar::rpc::protocol< Serializer, MsgType >::client:
seastar::rpc::client seastar::rpc::connection seastar::weakly_referencable< client >

Public Member Functions

 client (protocol &p, const socket_address &addr, const socket_address &local={})
 
 client (protocol &p, client_options options, const socket_address &addr, const socket_address &local={})
 
 client (protocol &p, socket socket, const socket_address &addr, const socket_address &local={})
 
 client (protocol &p, client_options options, socket socket, const socket_address &addr, const socket_address &local={})
 
stats get_stats () const
 
size_t incoming_queue_length () const noexcept
 
auto next_message_id ()
 
void wait_for_reply (id_type id, std::unique_ptr< reply_handler_base > &&h, std::optional< rpc_clock_type::time_point > timeout, cancellable *cancel)
 
void wait_timed_out (id_type id)
 
future stop () noexcept
 
void abort_all_streams ()
 
void deregister_this_stream ()
 
socket_address peer_address () const override
 
future await_connection ()
 
template<typename Serializer , typename... Out>
future< sink< Out... > > make_stream_sink (socket socket)
 
template<typename Serializer , typename... Out>
future< sink< Out... > > make_stream_sink ()
 
future request (uint64_t type, int64_t id, snd_buf buf, std::optional< rpc_clock_type::time_point > timeout={}, cancellable *cancel=nullptr)
 
size_t outgoing_queue_length () const noexcept
 
void set_socket (connected_socket &&fd)
 
future send_negotiation_frame (feature_map features)
 
bool error () const noexcept
 
void abort ()
 
future stream_receive (circular_buffer< foreign_ptr< std::unique_ptr< rcv_buf > > > &bufs)
 
future close_sink ()
 
bool sink_closed () const noexcept
 
future close_source ()
 
connection_id get_connection_id () const noexcept
 
statsget_stats_internal () noexcept
 
xshard_connection_ptr get_stream (connection_id id) const
 
void register_stream (connection_id id, xshard_connection_ptr c)
 
const loggerget_logger () const noexcept
 
template<typename Serializer >
Serializer & serializer ()
 
template<typename FrameType >
future< typename FrameType::return_type > read_frame (socket_address info, input_stream< char > &in)
 
template<typename FrameType >
future< typename FrameType::return_type > read_frame_compressed (socket_address info, std::unique_ptr< compressor > &compressor, input_stream< char > &in)
 
void suspend_for_testing (promise<> &p)
 
weak_ptr< clientweak_from_this () noexcept
 
weak_ptr< const clientweak_from_this () const noexcept
 

Protected Member Functions

void withdraw (outgoing_entry::container_t::iterator it, std::exception_ptr ex=nullptr)
 
void set_negotiated () noexcept
 
bool is_stream () const noexcept
 
snd_buf compress (snd_buf buf)
 
future send_buffer (snd_buf buf)
 
future send (snd_buf buf, std::optional< rpc_clock_type::time_point > timeout={}, cancellable *cancel=nullptr)
 
future send_entry (outgoing_entry &d) noexcept
 
future stop_send_loop (std::exception_ptr ex)
 
future< std::optional< rcv_buf > > read_stream_frame_compressed (input_stream< char > &in)
 
bool stream_check_twoway_closed () const noexcept
 
future stream_close ()
 
future stream_process_incoming (rcv_buf &&)
 
future handle_stream_frame ()
 

Protected Attributes

connected_socket _fd
 
input_stream< char > _read_buf
 
output_stream< char > _write_buf
 
bool _error = false
 
bool _connected = false
 
std::optional< shared_promise<> > _negotiated = shared_promise<>()
 
promise _stopped
 
stats _stats
 
const logger_logger
 
void * _serializer
 
future _outgoing_queue_ready = _negotiated->get_shared_future()
 
outgoing_entry::container_t _outgoing_queue
 
size_t _outgoing_queue_size = 0
 
std::unique_ptr< compressor_compressor
 
bool _propagate_timeout = false
 
bool _timeout_negotiated = false
 
bool _handler_duration_negotiated = false
 
bool _is_stream = false
 
connection_id _id = invalid_connection_id
 
std::unordered_map< connection_id, xshard_connection_ptr_streams
 
queue< rcv_buf_stream_queue = queue<rcv_buf>(max_queued_stream_buffers)
 
semaphore _stream_sem = semaphore(max_stream_buffers_memory)
 
bool _sink_closed = true
 
bool _source_closed = true
 
future< bool > _sink_closed_future = make_ready_future<bool>(false)
 

Constructor & Destructor Documentation

◆ client()

template<typename Serializer , typename MsgType = uint32_t>
seastar::rpc::protocol< Serializer, MsgType >::client::client ( protocol p,
socket  socket,
const socket_address addr,
const socket_address local = {} 
)
inline

Create client object which will attempt to connect to the remote address using the specified seastar::socket.

Parameters
addrthe remote address identifying this client
localthe local address of this client
socketthe socket object use to connect to the remote address

Member Function Documentation

◆ peer_address()

socket_address seastar::rpc::client::peer_address ( ) const
inlineoverridevirtualinherited

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