libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
A very simple socket-based server. More...
#include <socket_server.hpp>
Classes | |
struct | ctor_args |
Public Types | |
using | base_t = application |
using | exception_type = crt_exception< ppd::platform_api, ppd::heavyweight_threading > |
using | svr_mgr_t = SvrMgr |
using | server_to_client_flow_t = typename svr_mgr_t::server_to_client_flow_t |
using | socket_t = typename svr_mgr_t::socket_t |
using | socket_priority = typename svr_mgr_t::socket_priority |
using | msg_processor_t = msg_processor< ProcessingRules > |
using | proc_rules_t = typename msg_processor_t::proc_rules_t |
using | thread_t = ppd::jthread |
![]() | |
using | element_type = std::sig_atomic_t |
Public Member Functions | |
template<class LatencyTimestamps , class = typename std::enable_if<std::is_class<typename LatencyTimestamps::period>::value>::type> | |
svr (boost::asio::ip::address const &addr, unsigned short port_num, unsigned short timeout, socket_priority priority, thread_t::thread_traits::api_params_type::processor_mask_type mask, const thread_t::thread_traits::api_params_type::priority_type cpu_priority, proc_rules_t const &proc_ops, LatencyTimestamps &ts, char const *svr_name, server_to_client_flow_t &&server_to_client_flow=[](auto const &) {}) noexcept(false) | |
A simple socket-based server that listens to connections to the specified endpoint and responds to messages received in the specified manner. i.e. loops them back. More... | |
template<class LatencyTimestamps , class = typename std::enable_if<std::is_class<typename LatencyTimestamps::period>::value>::type> | |
svr (boost::asio::ip::address const &addr, unsigned short port_num, socket_priority priority, thread_t::thread_traits::api_params_type::processor_mask_type mask, const thread_t::thread_traits::api_params_type::priority_type cpu_priority, proc_rules_t const &proc_ops, LatencyTimestamps &ts, char const *svr_name, server_to_client_flow_t &&server_to_client_flow=[](auto const &) {}) noexcept(false) | |
template<class LatencyTimestamps , class = typename std::enable_if<std::is_class<typename LatencyTimestamps::period>::value>::type> | |
svr (boost::asio::ip::address const &addr, unsigned short port_num, unsigned short timeout, socket_priority priority, thread_t::thread_traits::api_params_type::processor_mask_type mask, const thread_t::thread_traits::api_params_type::priority_type cpu_priority, proc_rules_t const &proc_ops, socket_t &dest_skt, LatencyTimestamps &ts, char const *svr_name, server_to_client_flow_t &&server_to_client_flow=[](auto const &) {}) noexcept(false) | |
A simple socket-based server that listens to connections to the specified endpoint (e.g. a client that sends FIX messages) and responds to messages received in the specified manner. i.e. forwards the messages. More... | |
template<class LatencyTimestamps , class = typename std::enable_if<std::is_class<typename LatencyTimestamps::period>::value>::type> | |
svr (boost::asio::ip::address const &addr, unsigned short port_num, socket_priority priority, thread_t::thread_traits::api_params_type::processor_mask_type mask, const thread_t::thread_traits::api_params_type::priority_type cpu_priority, proc_rules_t const &proc_ops, socket_t &dest_skt, LatencyTimestamps &ts, server_to_client_flow_t &&server_to_client_flow=[](auto const &) {}) noexcept(false) | |
template<class LatencyTimestamps > | |
svr (ctor_args const &args, socket_priority priority, thread_t::thread_traits::api_params_type::processor_mask_type mask, const thread_t::thread_traits::api_params_type::priority_type cpu_priority, LatencyTimestamps &ts, server_to_client_flow_t &&server_to_client_flow=[](auto const &) {}) noexcept(false) | |
template<class LatencyTimestamps > | |
svr (ctor_args const &args, socket_t &dest_skt, unsigned short timeout, socket_priority priority, thread_t::thread_traits::api_params_type::processor_mask_type mask, const thread_t::thread_traits::api_params_type::priority_type cpu_priority, LatencyTimestamps &ts, char const *svr_name, server_to_client_flow_t &&server_to_client_flow=[](auto const &) {}) noexcept(false) | |
~svr () noexcept(true) | |
void | stop () noexcept(true) |
std::string | to_string () const noexcept(false) |
![]() | |
element_type | signal_status () const noexcept(true) |
Detect if a signal has been sent to the application. More... | |
Static Public Member Functions | |
static int | main (int argc, char const *const *argv) noexcept(true) |
A main() method for instantiating a stand-alone simulator. More... | |
Additional Inherited Members | |
![]() | |
application () noexcept(true) | |
application (application const &)=delete | |
virtual | ~application ()=default |
A very simple socket-based server.
This server only handles a single client at any time. Re-connections are possible.
Definition at line 48 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::base_t = application |
Definition at line 50 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::exception_type = crt_exception<ppd::platform_api, ppd::heavyweight_threading> |
Definition at line 51 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::msg_processor_t = msg_processor<ProcessingRules> |
Definition at line 56 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::proc_rules_t = typename msg_processor_t::proc_rules_t |
Definition at line 57 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::server_to_client_flow_t = typename svr_mgr_t::server_to_client_flow_t |
Definition at line 53 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::socket_priority = typename svr_mgr_t::socket_priority |
Definition at line 55 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::socket_t = typename svr_mgr_t::socket_t |
Definition at line 54 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr_mgr_t = SvrMgr |
Definition at line 52 of file socket_server.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::thread_t = ppd::jthread |
Definition at line 58 of file socket_server.hpp.
|
inlinenoexcept |
A simple socket-based server that listens to connections to the specified endpoint and responds to messages received in the specified manner. i.e. loops them back.
addr | The IPv4 or IPv6 address to which the connection should be made. |
port_num | The port number to which the connection should be made. |
priority | The priority at which the TCP messages should be sent, relating to QoS. |
proc_ops | The responses that the server should make to messages received on the endpoint, sent back to the connected endpoint. |
Definition at line 24 of file socket_server_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
|
inlinenoexcept |
Definition at line 58 of file socket_server_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
|
inlinenoexcept |
A simple socket-based server that listens to connections to the specified endpoint (e.g. a client that sends FIX messages) and responds to messages received in the specified manner. i.e. forwards the messages.
addr | The IPv4 or IPv6 address to which the connection should be made. |
port_num | The port number to which the connection should be made. |
priority | The priority at which the TCP messages should be sent, relating to QoS. |
proc_ops | The responses that the server should make to messages received on the endpoint. |
dest_skt | The socket to which the received messages should be forwarded after suitable processing. e.g. the exchange. |
Definition at line 65 of file socket_server_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
|
inlinenoexcept |
Definition at line 100 of file socket_server_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
|
inlinenoexcept |
Definition at line 107 of file socket_server_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
|
inlinenoexcept |
Definition at line 114 of file socket_server_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::svr().
|
inlinenoexcept |
Definition at line 119 of file socket_server_impl.hpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::stop().
|
inlinestaticnoexcept |
A main() method for instantiating a stand-alone simulator.
Use this within the CRT-main().
Definition at line 130 of file socket_server_impl.hpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::exit_crt_exception, jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::exit_print_help, jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::exit_print_version, jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::exit_stl_exception, jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::exit_success, jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::exit_unknown_exception, jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::exit_unknown_failure, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), and jmmcg::LIBJMMCG_VER_NAMESPACE::exit_codes::to_string().
|
inlinenoexcept |
Definition at line 124 of file socket_server_impl.hpp.
Referenced by jmmcg::LIBJMMCG_VER_NAMESPACE::socket::svr< ProcessingRules, SvrMgr >::~svr().
|
inlinenoexcept |
Definition at line 197 of file socket_server_impl.hpp.