HttpConnection.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FIX_HTTPCONNECTION_H
00023 #define FIX_HTTPCONNECTION_H
00024
00025 #ifdef _MSC_VER
00026 #pragma warning( disable : 4503 4355 4786 4290 )
00027 #endif
00028
00029 #include "HttpParser.h"
00030 #include <stdio.h>
00031
00032 namespace FIX
00033 {
00034 class HttpMessage;
00035
00037 class HttpConnection
00038 {
00039 public:
00040 HttpConnection( int s );
00041
00042 int getSocket() const { return m_socket; }
00043 bool read();
00044
00045 private:
00046 bool readMessage( std::string& msg ) throw( SocketRecvFailed );
00047 void processStream();
00048 void processRequest( const HttpMessage& );
00049 void processRoot( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00050 void processResetSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00051 void processRefreshSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00052 void processEnableSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00053 void processDisableSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00054 void processSession( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00055 void processResetSession( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00056 void processRefreshSession( const HttpMessage&, std::stringstream& h, std::stringstream& b );
00057
00058 void showToggle
00059 ( std::stringstream& s, const std::string& name, bool value, const std::string& url );
00060 void showRow
00061 ( std::stringstream& s, const std::string& name, bool value, const std::string& url = "" );
00062 void showRow
00063 ( std::stringstream& s, const std::string& name, const std::string& value, const std::string& url = "" );
00064 void showRow
00065 ( std::stringstream& s, const std::string& name, int value, const std::string& url = "" );
00066
00067 bool send( const std::string& );
00068 void disconnect( int error = 0 );
00069
00070 int m_socket;
00071 char m_buffer[BUFSIZ];
00072
00073 HttpParser m_parser;
00074 fd_set m_fds;
00075 };
00076 }
00077
00078 #endif