fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::ServerSession< T > Class Template Reference

#include <sessionwrapper.hpp>

Inheritance diagram for FIX8::ServerSession< T >:
FIX8::ServerSessionBase FIX8::SessionConfig FIX8::Configuration

Public Types

using ServerSession_ptr = std::unique_ptr< ServerSession< T >>
 Convenient scoped pointer for your session. More...
- Public Types inherited from FIX8::Configuration
enum  group_types {
  g_sessions, g_persisters, g_loggers, g_server_group,
  g_ssl_context, g_schedules, g_logins, g_client_group,
enum  Logtype { session_log, protocol_log }

Public Member Functions

 ServerSession (const F8MetaCntx &ctx, const std::string &conf_file, const std::string &session_name)
 Ctor. Prepares session for receiving inbbound connections (acceptor). More...
virtual ~ServerSession ()
 Dtor. More...
virtual SessionInstanceBasecreate_server_instance ()
virtual bool is_secure () const
- Public Member Functions inherited from FIX8::ServerSessionBase
 ServerSessionBase (const F8MetaCntx &ctx, const std::string &conf_file, const std::string &session_name)
 Ctor. Prepares session for receiving inbbound connections (acceptor). More...
virtual ~ServerSessionBase ()
 Dtor. More...
bool poll (const Poco::Timespan &span=Poco::Timespan(250000)) const
Poco::Net::StreamSocket accept (Poco::Net::SocketAddress &claddr)
- Public Member Functions inherited from FIX8::SessionConfig
 SessionConfig (const F8MetaCntx &ctx, const std::string &conf_file, const std::string &session_name)
 Ctor. Loads configuration, obtains session details, sets up logfile flags. More...
virtual ~SessionConfig ()
 Dtor. More...
const XmlElementget_session_element () const
- Public Member Functions inherited from FIX8::Configuration
const XmlElementfind_group (group_types type, const std::string &tag) const
 Configuration (const std::string &xmlfile, bool do_process=false)
 Configuration (std::istream &istr, bool do_process=false)
virtual ~Configuration ()
 Dtor. More...
F8API int process ()
const XmlElementget_session (const unsigned num) const
F8API Connection::Role get_role (const XmlElement *from) const
F8API size_t get_addresses (const XmlElement *from, std::vector< Server > &target) const
F8API Poco::Net::SocketAddress get_address (const XmlElement *from) const
F8API Poco::Net::IPAddress get_ip (const XmlElement *from) const
template<typename T >
get_logflags (const std::string &tag, const std::vector< std::string > &names, const XmlElement *from, Logger::LogPositions *positions=nullptr) const
F8API std::string & get_logname (const XmlElement *from, std::string &to, const SessionID *sid=nullptr) const
unsigned get_connect_timeout (const XmlElement *from, const unsigned def=defaults::connect_timeout) const
unsigned get_retry_interval (const XmlElement *from, const unsigned def=defaults::retry_interval) const
unsigned get_retry_count (const XmlElement *from, const int def=defaults::login_retries) const
unsigned get_tcp_recvbuf_sz (const XmlElement *from, const unsigned def=0) const
unsigned get_tcp_sendbuf_sz (const XmlElement *from, const unsigned def=0) const
unsigned get_version (const XmlElement *from, const unsigned def=0) const
unsigned get_tabsize (const XmlElement *from, const unsigned def=defaults::tabsize) const
unsigned get_logfile_rotation (const XmlElement *from, const unsigned def=defaults::log_rotation) const
unsigned get_heartbeat_interval (const XmlElement *from, const unsigned def=defaults::hb_interval) const
bool get_tcp_nodelay (const XmlElement *from, const bool def=true) const
bool get_tcp_keepalive (const XmlElement *from, const bool def=false) const
bool get_tcp_reuseaddr (const XmlElement *from, const bool def=false) const
int get_tcp_linger (const XmlElement *from, const int def=-1) const
bool get_silent_disconnect (const XmlElement *from, const bool def=false) const
bool get_enforce_compids_flag (const XmlElement *from, const bool def=true) const
bool get_ignore_logon_sequence_check_flag (const XmlElement *from, const bool def=false) const
bool get_no_chksum_flag (const XmlElement *from, const bool def=false) const
bool get_permissive_mode_flag (const XmlElement *from, const bool def=false) const
bool get_reset_sequence_number_flag (const XmlElement *from, const bool def=false) const
bool get_always_seqnum_assign (const XmlElement *from, const bool def=false) const
F8API ProcessModel get_process_model (const XmlElement *from) const
default_appl_ver_id get_default_appl_ver_id (const XmlElement *from) const
sender_comp_id get_sender_comp_id (const XmlElement *from) const
target_comp_id get_target_comp_id (const XmlElement *from) const
F8API Persistercreate_persister (const XmlElement *from, const SessionID *sid=nullptr, bool flag=false) const
F8API Loggercreate_logger (const XmlElement *from, const Logtype ltype, const SessionID *sid=nullptr) const
F8API Schedule create_schedule (const XmlElement *from) const
F8API Clients create_clients (const XmlElement *from) const
F8API Schedule create_login_schedule (const XmlElement *from) const
F8API Session_Schedulecreate_session_schedule (const XmlElement *from) const
F8API unsigned get_all_sessions (std::vector< const XmlElement * > &target, const Connection::Role role=Connection::cn_unknown) const
const XmlElementget_root () const
template<typename T >
get_logflags (const string &tag, const vector< string > &names, const XmlElement *from, Logger::LogPositions *positions) const

Private Attributes

Poco::Net::SocketAddress _addr

Additional Inherited Members

- Public Attributes inherited from FIX8::SessionConfig
const F8MetaCntx_ctx
const XmlElement_ses
LoginParameters _loginParameters
const std::string _session_name
- Protected Member Functions inherited from FIX8::Configuration
bool from_or_default (const XmlElement *from, const f8String &tag, f8String &target) const
template<typename T >
T & get_string_field (const XmlElement *from, const std::string &tag, T &to) const
Tickval::ticks get_time_field (const XmlElement *from, const std::string &tag, bool timeonly=false) const
template<typename T >
find_or_default (const XmlElement *from, const std::string &tag, const T def) const
- Protected Attributes inherited from FIX8::ServerSessionBase
Poco::Net::ServerSocket * _server_sock = nullptr

Detailed Description

template<typename T>
class FIX8::ServerSession< T >

Template Parameters
Tspecialised with your derived session class

Definition at line 544 of file sessionwrapper.hpp.

Member Typedef Documentation

template<typename T>
using FIX8::ServerSession< T >::ServerSession_ptr = std::unique_ptr<ServerSession<T>>

Convenient scoped pointer for your session.

Definition at line 580 of file sessionwrapper.hpp.

Constructor & Destructor Documentation

template<typename T>
FIX8::ServerSession< T >::ServerSession ( const F8MetaCntx ctx,
const std::string &  conf_file,
const std::string &  session_name 

Ctor. Prepares session for receiving inbbound connections (acceptor).

Definition at line 553 of file sessionwrapper.hpp.

References FIX8::SessionConfig::_loginParameters, FIX8::LoginParameters::_recv_buf_sz, FIX8::LoginParameters::_send_buf_sz, FIX8::Connection::set_recv_buf_sz(), and FIX8::Connection::set_send_buf_sz().

553  :
554  ServerSessionBase(ctx, conf_file, session_name),
556 #ifdef FIX8_HAVE_OPENSSL
557  ,_ssl(get_ssl_context(_ses), false)
558 #endif
559  {
560  _server_sock =
561 #ifdef FIX8_HAVE_OPENSSL
562  _ssl.is_secure() ? new Poco::Net::SecureServerSocket(_addr, 64, _ssl._context) :
563 #endif
564  new Poco::Net::ServerSocket(_addr);
570  }
LoginParameters _loginParameters
ServerSessionBase(const F8MetaCntx &ctx, const std::string &conf_file, const std::string &session_name)
Ctor. Prepares session for receiving inbbound connections (acceptor).
static void set_recv_buf_sz(const unsigned sz, Poco::Net::Socket *sock)
Definition: connection.hpp:633
F8API Poco::Net::SocketAddress get_address(const XmlElement *from) const
Poco::Net::ServerSocket * _server_sock
static void set_send_buf_sz(const unsigned sz, Poco::Net::Socket *sock)
Definition: connection.hpp:644
const F8MetaCntx & ctx()
Compiler generated metadata object, accessed through this function.
const XmlElement * _ses
Poco::Net::SocketAddress _addr
template<typename T>
virtual FIX8::ServerSession< T >::~ServerSession ( )


Definition at line 573 of file sessionwrapper.hpp.

573 {}

Member Function Documentation

template<typename T >
SessionInstanceBase * FIX8::ServerSession< T >::create_server_instance ( )

Create a SessionInstance for the associated Session

base pointer to new SessionInstance

Implements FIX8::ServerSessionBase.

Definition at line 728 of file sessionwrapper.hpp.

728 { return new SessionInstance<T>(*this); }
template<typename T>
virtual bool FIX8::ServerSession< T >::is_secure ( ) const

Check if this server session supports secure connections

true if supported

Reimplemented from FIX8::ServerSessionBase.

Definition at line 582 of file sessionwrapper.hpp.

584  { return _ssl.is_secure(); }
585 #else
586  { return false; }

Member Data Documentation

template<typename T>
Poco::Net::SocketAddress FIX8::ServerSession< T >::_addr

Definition at line 546 of file sessionwrapper.hpp.

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