OnixS CBOE CMi2 Trading Handler for C++  1.1.3.0
Public Member Functions | Static Public Member Functions | List of all members
Handler Class Reference

CBOE CMi2 Trading Handler. More...

Public Member Functions

 Handler (const HandlerSettings &settings)
 Performs instance initialization. More...
 
void connect (const std::string &hostName, UInt16 port, const Logon &logon, const std::string &localNetworkInterface="")
 Establishes the connection. More...
 
void disconnect ()
 Force session disconnect. More...
 
void disconnectAsync ()
 Async force session disconnect. More...
 
UInt32 send (Message &, bool warmupMode=false)
 Send message. More...
 
UInt32 send (SerializedMessage &)
 Send message. More...
 
void nextSendingSeqNum (UInt32 value)
 Sets the next sequence number for sending messages. More...
 
void registerErrorListener (ErrorListener *listener)
 Assigns listener for errors occurred while executing handler. More...
 
void registerWarningListener (WarningListener *listener)
 Assigns listener for warnings occurred while executing handler. More...
 
void registerHandlerStateListener (HandlerStateListener *listener)
 Assigns listener for state change events occurred while executing handler. More...
 
void registerSessionListener (SessionListener *listener)
 Assigns listener for session events occurred while executing handler. More...
 
void registerAdminMessageListener (AdminMessageListener *listener)
 Assigns listener for administrative events. More...
 
void registerMessageListener (MessageListener *listener)
 Assigns listener for exchange events. More...
 
HandlerState::Enum state () const
 Returns handler state. More...
 
UInt32 outboundQueueBytes ()
 return outbound queue size More...
 
void log (LogLevel::Enum logLevel, const char *logMessage, size_t length)
 Logs the given user-level message to the handler log. More...
 
void log (LogLevel::Enum logLevel, const char *logMessage)
 Logs the given user-level message to the handler log. More...
 
void log (LogLevel::Enum logLevel, const std::string &str)
 Logs the given user-level message to the handler log. More...
 
UInt32 userSessionKey () const
 Returns CMi2 user session key for the most recent successful connection. More...
 
const std::string & licenseExpirationDate () const
 Returns the license expiration date. More...
 

Static Public Member Functions

static const std::string & version ()
 Returns Handler's version. More...
 

Detailed Description

CBOE CMi2 Trading Handler.

Constructor & Destructor Documentation

Handler ( const HandlerSettings settings)

Performs instance initialization.

Parameters
settingsdefines values for various options which affect handler behavior like enabling logging during execution of the handler.

Member Function Documentation

void connect ( const std::string &  hostName,
UInt16  port,
const Logon logon,
const std::string &  localNetworkInterface = "" 
)

Establishes the connection.

Note
Blocks until the logon reply is received.
Should be called only when Handler is disconnected.
Parameters
hostNameHostname to connect to.
portPort number to connect to.
logonInitial logon message parameters.
localNetworkInterfaceLocal network interface.
Exceptions
std::exceptionCannot set the local network interface.
std::exceptionCannot connect to hostname on port.
std::exceptionCannot configure size of receive buffer for the socket.
std::exceptionCannot configure size of send buffer for the socket.
OperationExceptionInvalid argument is given.
void disconnect ( )

Force session disconnect.

Note
Blocks until the Session Logout procedure is finished.
void disconnectAsync ( )

Async force session disconnect.

const std::string& licenseExpirationDate ( ) const

Returns the license expiration date.

void log ( LogLevel::Enum  logLevel,
const char *  logMessage,
size_t  length 
)

Logs the given user-level message to the handler log.

void log ( LogLevel::Enum  logLevel,
const char *  logMessage 
)

Logs the given user-level message to the handler log.

void log ( LogLevel::Enum  logLevel,
const std::string &  str 
)

Logs the given user-level message to the handler log.

void nextSendingSeqNum ( UInt32  value)

Sets the next sequence number for sending messages.

UInt32 outboundQueueBytes ( )

return outbound queue size

void registerAdminMessageListener ( AdminMessageListener listener)

Assigns listener for administrative events.

It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerErrorListener ( ErrorListener listener)

Assigns listener for errors occurred while executing handler.

It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected
void registerHandlerStateListener ( HandlerStateListener listener)

Assigns listener for state change events occurred while executing handler.

It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerMessageListener ( MessageListener listener)

Assigns listener for exchange events.

It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerSessionListener ( SessionListener listener)

Assigns listener for session events occurred while executing handler.

It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerWarningListener ( WarningListener listener)

Assigns listener for warnings occurred while executing handler.

It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected
UInt32 send ( Message ,
bool  warmupMode = false 
)

Send message.

Returns
next sequence number for sent messages
Exceptions
OperationExceptionAttempt to send data before connection creation
std::exceptionwith system dependent message if sending has been failed
UInt32 send ( SerializedMessage )

Send message.

Returns
next sequence number for sent messages
Exceptions
OperationExceptionAttempt to send data before connection creation
std::exceptionwith system dependent message if sending has been failed
HandlerState::Enum state ( ) const

Returns handler state.

UInt32 userSessionKey ( ) const

Returns CMi2 user session key for the most recent successful connection.

static const std::string& version ( )
static

Returns Handler's version.