HttpConnection.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_HTTPCONNECTION_H
23 #define FIX_HTTPCONNECTION_H
24 
25 #ifdef _MSC_VER
26 #pragma warning( disable : 4503 4355 4786 4290 )
27 #endif
28 
29 #include "HttpParser.h"
30 #include <stdio.h>
31 
32 namespace FIX
33 {
34 class HttpMessage;
35 
38 {
39 public:
40  HttpConnection( int s );
41 
42  int getSocket() const { return m_socket; }
43  bool read();
44 
45 private:
46  bool readMessage( std::string& msg ) throw( SocketRecvFailed );
47  void processStream();
48  void processRequest( const HttpMessage& );
49  void processRoot( const HttpMessage&, std::stringstream& h, std::stringstream& b );
50  void processResetSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
51  void processRefreshSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
52  void processEnableSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
53  void processDisableSessions( const HttpMessage&, std::stringstream& h, std::stringstream& b );
54  void processSession( const HttpMessage&, std::stringstream& h, std::stringstream& b );
55  void processResetSession( const HttpMessage&, std::stringstream& h, std::stringstream& b );
56  void processRefreshSession( const HttpMessage&, std::stringstream& h, std::stringstream& b );
57 
58  void showToggle
59  ( std::stringstream& s, const std::string& name, bool value, const std::string& url );
60  void showRow
61  ( std::stringstream& s, const std::string& name, bool value, const std::string& url = "" );
62  void showRow
63  ( std::stringstream& s, const std::string& name, const std::string& value, const std::string& url = "" );
64  void showRow
65  ( std::stringstream& s, const std::string& name, int value, const std::string& url = "" );
66 
67  bool send( const std::string& );
68  void disconnect( int error = 0 );
69 
70  int m_socket;
71  char m_buffer[BUFSIZ];
72 
74  fd_set m_fds;
75 };
76 }
77 
78 #endif
void showRow(std::stringstream &s, const std::string &name, bool value, const std::string &url="")
Encapsulates a HTTP socket file descriptor.
void processResetSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
int getSocket() const
Parses HTTP messages off an input stream.
Definition: HttpParser.h:36
bool readMessage(std::string &msg)
void processSession(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processRoot(const HttpMessage &, std::stringstream &h, std::stringstream &b)
Definition: Acceptor.cpp:34
Socket recv operation failed.
Definition: Exceptions.h:280
void processEnableSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processRefreshSession(const HttpMessage &, std::stringstream &h, std::stringstream &b)
HTTP Message that implemented GET functionality.
Definition: HttpMessage.h:37
char m_buffer[BUFSIZ]
void processDisableSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void showToggle(std::stringstream &s, const std::string &name, bool value, const std::string &url)
void processRefreshSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
bool send(const std::string &)
void processResetSession(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processRequest(const HttpMessage &)
void disconnect(int error=0)

Generated on Thu Sep 5 2019 11:07:58 for QuickFIX by doxygen 1.8.13 written by Dimitri van Heesch, © 1997-2001