5 #ifndef HH_HTTPConnection_
6 #define HH_HTTPConnection_ 1
9 #include <boost/utility.hpp>
10 #include <boost/intrusive_ptr.hpp>
11 #include <boost/scoped_ptr.hpp>
12 #include "Socket/ClientSocketHandle.hh"
13 #include "Utils/intrusive_refcount.hh"
14 #include "Scheduler/ReadHelper.hh"
15 #include "Scheduler/WriteHelper.hh"
16 #include "HTTPLogger.hh"
17 #include "HTTPRequest.hh"
19 //#include "HTTPConnection.mpp"
20 ///////////////////////////////hh.p////////////////////////////////////////
25 class SimpleHTTPServer;
26 class StreamConnection;
29 : public satcom::lib::intrusive_refcount
32 ///////////////////////////////////////////////////////////////////////////
35 typedef boost::intrusive_ptr<HTTPConnection> ptr;
36 typedef satcom::lib::ClientSocketHandle<
37 satcom::lib::MakeSocketPolicy<satcom::lib::ConnectedCommunicationPolicy,
38 satcom::lib::StreamFramingPolicy,
39 satcom::lib::ReadablePolicy,
40 satcom::lib::WriteablePolicy>::policy> ClientHandle;
42 static const unsigned MaxRequestSize = 16384;
43 static const unsigned StreamBufferMSecs = 4000;
45 ///////////////////////////////////////////////////////////////////////////
46 ///\name Structors and default members
49 HTTPConnection(ClientHandle client, SimpleHTTPServer & server, HTTPLogger & logger);
53 ///////////////////////////////////////////////////////////////////////////
60 void handleRequest(satcom::lib::ReadHelper<ClientHandle>::ptr);
61 void startStream(satcom::lib::WriteHelper<ClientHandle>::ptr);
64 SimpleHTTPServer & server_;
67 boost::scoped_ptr<StreamConnection> connection_;
74 ///////////////////////////////hh.e////////////////////////////////////////
75 //#include "HTTPConnection.cci"
76 //#include "HTTPConnection.ct"
77 //#include "HTTPConnection.cti"
78 //#include "HTTPConnection.mpp"