HttpServer.h
Go to the documentation of this file.
1/* -*- C++ -*- */
2
3/****************************************************************************
4** Copyright (c) 2001-2014
5**
6** This file is part of the QuickFIX FIX Engine
7**
8** This file may be distributed under the terms of the quickfixengine.org
9** license as defined by quickfixengine.org and appearing in the file
10** LICENSE included in the packaging of this file.
11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14**
15** See http://www.quickfixengine.org/LICENSE for licensing information.
16**
17** Contact ask@quickfixengine.org if any conditions of this licensing are
18** not clear to you.
19**
20****************************************************************************/
21
22#ifndef FIX_HTTPSERVER_H
23#define FIX_HTTPSERVER_H
24
25#ifdef _MSC_VER
26#pragma warning( disable : 4503 4355 4786 4290 )
27#endif
28
29#include "SocketServer.h"
30#include "SessionSettings.h"
31#include "Exceptions.h"
32#include "Mutex.h"
33
34namespace FIX
35{
38{
39public:
40 HttpServer( const SessionSettings& ) throw( ConfigError );
41
42 static void startGlobal( const SessionSettings& ) throw ( ConfigError, RuntimeError );
43 static void stopGlobal();
44
45 void start() throw ( ConfigError, RuntimeError );
46 void stop();
47
48private:
49 void onConfigure( const SessionSettings& ) throw ( ConfigError );
50 void onInitialize( const SessionSettings& ) throw ( RuntimeError );
51
52 void onStart();
53 bool onPoll();
54 void onStop();
55
56 void onConnect( SocketServer&, int, int );
57 void onWrite( SocketServer&, int );
58 bool onData( SocketServer&, int );
59 void onDisconnect( SocketServer&, int );
60 void onError( SocketServer& );
61 void onTimeout( SocketServer& );
62
63 static THREAD_PROC startThread( void* p );
64
68 int m_port;
69 bool m_stop;
70
71 static Mutex s_mutex;
72 static int s_count;
74};
76}
77
78#endif //FIX_HTTPSERVER_H
#define THREAD_PROC
Definition Utility.h:184
Basic HTTP Server.
Definition HttpServer.h:38
static void startGlobal(const SessionSettings &)
static void stopGlobal()
bool onData(SocketServer &, int)
void onError(SocketServer &)
void onWrite(SocketServer &, int)
static int s_count
Definition HttpServer.h:72
void onConfigure(const SessionSettings &)
void onInitialize(const SessionSettings &)
static HttpServer * s_pServer
Definition HttpServer.h:73
static Mutex s_mutex
Definition HttpServer.h:71
SessionSettings m_settings
Definition HttpServer.h:66
static THREAD_PROC startThread(void *p)
void onTimeout(SocketServer &)
void onDisconnect(SocketServer &, int)
SocketServer * m_pServer
Definition HttpServer.h:65
thread_id m_threadid
Definition HttpServer.h:67
void onConnect(SocketServer &, int, int)
Portable implementation of a mutex.
Definition Mutex.h:31
Container for setting dictionaries mapped to sessions.
Listens for and accepts incoming socket connections on a port.
pthread_t thread_id
Definition Utility.h:190
Application is not configured correctly
Definition Exceptions.h:88
Application encountered serious error during runtime
Definition Exceptions.h:95

Generated on Thu Feb 29 2024 22:38:19 for QuickFIX by doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2001