root / trunk / tbeta / Linux / libs / poco / include / Poco / Net / HTTPServerConnection.h @ 164

View | Annotate | Download (2.6 KB)

1 164 ss
//
2 164 ss
// HTTPServerConnection.h
3 164 ss
//
4 164 ss
// $Id: //poco/1.3/Net/include/Poco/Net/HTTPServerConnection.h#2 $
5 164 ss
//
6 164 ss
// Library: Net
7 164 ss
// Package: HTTPServer
8 164 ss
// Module:  HTTPServerConnection
9 164 ss
//
10 164 ss
// Definition of the HTTPServerConnection class.
11 164 ss
//
12 164 ss
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
13 164 ss
// and Contributors.
14 164 ss
//
15 164 ss
// Permission is hereby granted, free of charge, to any person or organization
16 164 ss
// obtaining a copy of the software and accompanying documentation covered by
17 164 ss
// this license (the "Software") to use, reproduce, display, distribute,
18 164 ss
// execute, and transmit the Software, and to prepare derivative works of the
19 164 ss
// Software, and to permit third-parties to whom the Software is furnished to
20 164 ss
// do so, all subject to the following:
21 164 ss
//
22 164 ss
// The copyright notices in the Software and this entire statement, including
23 164 ss
// the above license grant, this restriction and the following disclaimer,
24 164 ss
// must be included in all copies of the Software, in whole or in part, and
25 164 ss
// all derivative works of the Software, unless such copies or derivative
26 164 ss
// works are solely in the form of machine-executable object code generated by
27 164 ss
// a source language processor.
28 164 ss
//
29 164 ss
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 164 ss
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 164 ss
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
32 164 ss
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
33 164 ss
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
34 164 ss
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
35 164 ss
// DEALINGS IN THE SOFTWARE.
36 164 ss
//
37 164 ss
38 164 ss
39 164 ss
#ifndef Net_HTTPServerConnection_INCLUDED
40 164 ss
#define Net_HTTPServerConnection_INCLUDED
41 164 ss
42 164 ss
43 164 ss
#include "Poco/Net/Net.h"
44 164 ss
#include "Poco/Net/TCPServerConnection.h"
45 164 ss
#include "Poco/Net/HTTPResponse.h"
46 164 ss
47 164 ss
48 164 ss
namespace Poco {
49 164 ss
namespace Net {
50 164 ss
51 164 ss
52 164 ss
class HTTPServerParams;
53 164 ss
class HTTPRequestHandlerFactory;
54 164 ss
class HTTPServerSession;
55 164 ss
56 164 ss
57 164 ss
class Net_API HTTPServerConnection: public TCPServerConnection
58 164 ss
        /// This subclass of TCPServerConnection handles HTTP
59 164 ss
        /// connections.
60 164 ss
{
61 164 ss
public:
62 164 ss
        HTTPServerConnection(const StreamSocket& socket, HTTPServerParams* pParams, HTTPRequestHandlerFactory* pFactory);
63 164 ss
                /// Creates the HTTPServerConnection.
64 164 ss
65 164 ss
        virtual ~HTTPServerConnection();
66 164 ss
                /// Destroys the HTTPServerConnection.
67 164 ss
68 164 ss
        void run();
69 164 ss
                /// Handles all HTTP requests coming in.
70 164 ss
71 164 ss
protected:
72 164 ss
        void sendErrorResponse(HTTPServerSession& session, HTTPResponse::HTTPStatus status);
73 164 ss
74 164 ss
private:
75 164 ss
        HTTPServerParams*          _pParams;
76 164 ss
        HTTPRequestHandlerFactory* _pFactory;
77 164 ss
};
78 164 ss
79 164 ss
80 164 ss
} } // namespace Poco::Net
81 164 ss
82 164 ss
83 164 ss
#endif // Net_HTTPServerConnection_INCLUDED