kodi
PltFrameServer.h
1 /*****************************************************************
2 |
3 | Platinum - Frame Server
4 |
5 | Copyright (c) 2004-2010, Plutinosoft, LLC.
6 | All rights reserved.
7 | http://www.plutinosoft.com
8 |
9 | This program is free software; you can redistribute it and/or
10 | modify it under the terms of the GNU General Public License
11 | as published by the Free Software Foundation; either version 2
12 | of the License, or (at your option) any later version.
13 |
14 | OEMs, ISVs, VARs and other distributors that combine and
15 | distribute commercially licensed software with Platinum software
16 | and do not wish to distribute the source code for the commercially
17 | licensed software under version 2, or (at your option) any later
18 | version, of the GNU General Public License (the "GPL") must enter
19 | into a commercial license agreement with Plutinosoft, LLC.
20 | licensing@plutinosoft.com
21 |
22 | This program is distributed in the hope that it will be useful,
23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | GNU General Public License for more details.
26 |
27 | You should have received a copy of the GNU General Public License
28 | along with this program; see the file LICENSE.txt. If not, write to
29 | the Free Software Foundation, Inc.,
30 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 | http://www.gnu.org/licenses/gpl-2.0.html
32 |
33 ****************************************************************/
34 
35 #ifndef _PLT_FRAME_SERVER_H_
36 #define _PLT_FRAME_SERVER_H_
37 
38 /*----------------------------------------------------------------------
39 | includes
40 +---------------------------------------------------------------------*/
41 #include "Neptune.h"
42 #include "PltHttpServer.h"
43 #include "PltFrameBuffer.h"
44 
45 /*----------------------------------------------------------------------
46 | forward declarations
47 +---------------------------------------------------------------------*/
49 
50 /*----------------------------------------------------------------------
51 | PLT_StreamValidator class
52 +---------------------------------------------------------------------*/
54 {
55 public:
56  virtual ~PLT_StreamValidator() {}
57  virtual bool OnNewRequestAccept(const NPT_HttpRequest& request,
58  const NPT_HttpRequestContext& context,
59  NPT_HttpResponse& response,
60  NPT_Reference<PLT_FrameBuffer>& buffer) = 0;
61 };
62 
63 /*----------------------------------------------------------------------
64 | PLT_HttpStreamRequestHandler
65 +---------------------------------------------------------------------*/
67 {
68 public:
69  // constructor
71  m_StreamValidator(stream_validator) {}
72 
73  // NPT_HttpRequestHandler methods
74  NPT_Result SetupResponse(NPT_HttpRequest& request,
75  const NPT_HttpRequestContext& context,
76  NPT_HttpResponse& response) override;
77 
78 private:
79  PLT_StreamValidator& m_StreamValidator;
80 };
81 
82 /*----------------------------------------------------------------------
83 | PLT_FrameServer class
84 +---------------------------------------------------------------------*/
86 {
87 public:
88  PLT_FrameServer(const char* resource_name,
89  PLT_StreamValidator& stream_validator,
90  NPT_IpAddress address = NPT_IpAddress::Any,
91  NPT_UInt16 port = 0,
92  bool policy_server_enabled = false);
93  ~PLT_FrameServer() override;
94 
95  NPT_Result Start() override;
96 
97 protected:
98  PLT_SocketPolicyServer* m_PolicyServer;
99  PLT_StreamValidator& m_StreamValidator;
100  bool m_PolicyServerEnabled;
101 };
102 
103 #endif /* _PLT_FRAME_SERVER_H_ */
Definition: PltFrameServer.h:53
Definition: NptHttp.h:566
The PLT_HttpServer class provides an asynchronous way to handle multiple HTTP requests concurrently...
Definition: PltHttpServer.h:55
Definition: NptHttp.h:315
Definition: NptHttp.h:282
Definition: NptHttp.h:593
Definition: NptNetwork.h:74
Definition: PltFrameServer.cpp:52
HTTP Server.
Definition: PltFrameServer.h:85
Definition: PltFrameServer.h:66