FIX::ServerWrapper Class Reference

Handles events from SocketMonitor for server connections. More...

Inheritance diagram for FIX::ServerWrapper:
[legend]
Collaboration diagram for FIX::ServerWrapper:
[legend]

## Public Member Functions

| ServerWrapper (std::set< int > sockets, SocketServer &server, SocketServer::Strategy &strategy)
Public Member Functions inherited from FIX::SocketMonitor::Strategy
virtual | ~Strategy ()

## Private Types

typedef std::set< int > | Sockets

## Private Member Functions

void | onConnect (SocketMonitor &, int socket)
void | onEvent (SocketMonitor &monitor, int socket)
void | onWrite (SocketMonitor &, int socket)
void | onError (SocketMonitor &monitor, int socket)
void | onError (SocketMonitor &)
void | onTimeout (SocketMonitor &)

## Private Attributes

Sockets | m_sockets
SocketServer & | m_server
SocketServer::Strategy & | m_strategy

## Detailed Description

Handles events from SocketMonitor for server connections.

Definition at line 40 of file SocketServer.cpp.

## Member Typedef Documentation

## Sockets

typedef std::set<int> FIX::ServerWrapper::Sockets

private

Definition at line 87 of file SocketServer.cpp.

## Constructor & Destructor Documentation

## ServerWrapper()

FIX::ServerWrapper::ServerWrapper | ( | std::set< int > | sockets,
|  | SocketServer & | server,
|  | SocketServer::Strategy & | strategy
| ) |  |

inline

Definition at line 43 of file SocketServer.cpp.

: m_sockets( sockets ), m_server( server ), m_strategy( strategy ) {}
FIX::ServerWrapper::m_strategy
SocketServer::Strategy & m_strategy
Definition: SocketServer.cpp:91
FIX::ServerWrapper::m_sockets
Sockets m_sockets
Definition: SocketServer.cpp:89
FIX::ServerWrapper::m_server
SocketServer & m_server
Definition: SocketServer.cpp:90

## Member Function Documentation

## onConnect()

void FIX::ServerWrapper::onConnect | ( | SocketMonitor & | ,
|  | int | socket
| ) |  |

inline private virtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 48 of file SocketServer.cpp.

{
}

## onError() [1/2]

void FIX::ServerWrapper::onError | ( | SocketMonitor & |  | ) |

inline private virtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 76 of file SocketServer.cpp.

{
m_strategy.onError( m_server );
}
FIX::SocketServer::Strategy::onError
virtual void onError(SocketServer &)=0

References m_server, m_strategy, and FIX::SocketServer::Strategy::onError().

## onError() [2/2]

void FIX::ServerWrapper::onError | ( | SocketMonitor & | monitor,
|  | int | socket
| ) |  |

inline private virtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 70 of file SocketServer.cpp.

{
m_strategy.onDisconnect( m_server, socket );
monitor.drop( socket );
}
FIX::SocketServer::Strategy::onDisconnect
virtual void onDisconnect(SocketServer &, int socket)=0

References FIX::SocketMonitor::drop(), m_server, m_strategy, and FIX::SocketServer::Strategy::onDisconnect().

Referenced by onEvent().

## onEvent()

void FIX::ServerWrapper::onEvent | ( | SocketMonitor & | monitor,
|  | int | socket
| ) |  |

inline private virtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 52 of file SocketServer.cpp.

{
if( m_sockets.find(socket) != m_sockets.end() )
{
m_strategy.onConnect( m_server, socket, m_server.accept(socket) );
}
else
{
if( !m_strategy.onData( m_server, socket ) )
onError( monitor, socket );
}
}
FIX::ServerWrapper::onError
void onError(SocketMonitor &monitor, int socket)
Definition: SocketServer.cpp:70
FIX::SocketServer::Strategy::onConnect
virtual void onConnect(SocketServer &, int acceptSocket, int socket)=0
FIX::SocketServer::Strategy::onData
virtual bool onData(SocketServer &, int socket)=0
FIX::SocketServer::accept
int accept(int socket)
Definition: SocketServer.cpp:121

References FIX::SocketServer::accept(), m_server, m_sockets, m_strategy, FIX::SocketServer::Strategy::onConnect(), FIX::SocketServer::Strategy::onData(), and onError().

## onTimeout()

void FIX::ServerWrapper::onTimeout | ( | SocketMonitor & |  | ) |

inline private virtual

Reimplemented from FIX::SocketMonitor::Strategy.

Definition at line 81 of file SocketServer.cpp.

{
m_strategy.onTimeout( m_server );
};
FIX::SocketServer::Strategy::onTimeout
virtual void onTimeout(SocketServer &)
Definition: SocketServer.h:95

References m_server, m_strategy, and FIX::SocketServer::Strategy::onTimeout().

## onWrite()

void FIX::ServerWrapper::onWrite | ( | SocketMonitor & | ,
|  | int | socket
| ) |  |

inline private virtual

Implements FIX::SocketMonitor::Strategy.

Definition at line 65 of file SocketServer.cpp.

{
m_strategy.onWrite( m_server, socket );
}
FIX::SocketServer::Strategy::onWrite
virtual void onWrite(SocketServer &, int socket)=0

References m_server, m_strategy, and FIX::SocketServer::Strategy::onWrite().

## Member Data Documentation

## m_server

SocketServer& FIX::ServerWrapper::m_server

private

Definition at line 90 of file SocketServer.cpp.

Referenced by onError(), onEvent(), onTimeout(), and onWrite().

## m_sockets

Sockets FIX::ServerWrapper::m_sockets

private

Definition at line 89 of file SocketServer.cpp.

Referenced by onEvent().

## m_strategy

SocketServer::Strategy& FIX::ServerWrapper::m_strategy

private

Definition at line 91 of file SocketServer.cpp.

Referenced by onError(), onEvent(), onTimeout(), and onWrite().

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

- SocketServer.cpp