Nuria Framework - Network
Network module of the NuriaProject Framework
 All Classes Functions Typedefs Enumerations Enumerator
httptransport.hpp
1 /* Copyright (c) 2014, The Nuria Project
2  * This software is provided 'as-is', without any express or implied
3  * warranty. In no event will the authors be held liable for any damages
4  * arising from the use of this software.
5  * Permission is granted to anyone to use this software for any purpose,
6  * including commercial applications, and to alter it and redistribute it
7  * freely, subject to the following restrictions:
8  * 1. The origin of this software must not be misrepresented; you must not
9  * claim that you wrote the original software. If you use this software
10  * in a product, an acknowledgment in the product documentation would be
11  * appreciated but is not required.
12  * 2. Altered source versions must be plainly marked as such, and must not be
13  * misrepresented as being the original software.
14  * 3. This notice may not be removed or altered from any source
15  * distribution.
16  */
17 
18 #ifndef NURIA_HTTPTRANSPORT_HPP
19 #define NURIA_HTTPTRANSPORT_HPP
20 
21 #include "network_global.hpp"
22 #include <QHostAddress>
23 #include <QIODevice>
24 
25 namespace Nuria {
26 
34 class NURIA_NETWORK_EXPORT HttpTransport : public QIODevice {
35  Q_OBJECT
36  Q_ENUMS(Type)
37 public:
38 
40  enum Type {
41 
43  Unknown = 0,
44 
46  TCP = 1,
47 
49  SSL = 2,
50 
52  Memory = 3,
53 
55  Custom = 4
56  };
57 
59  explicit HttpTransport (QObject *parent = 0);
60 
62  ~HttpTransport ();
63 
68  virtual Type type () const;
69 
75  virtual bool isSecure () const;
76 
81  virtual QHostAddress localAddress () const;
82 
87  virtual quint16 localPort () const;
88 
93  virtual QHostAddress peerAddress () const;
94 
99  virtual quint16 peerPort () const;
100 
101 public slots:
102 
107  virtual bool flush ();
108 
114  virtual void forceClose ();
115 
116 };
117 
118 }
119 
120 #endif // NURIA_HTTPTRANSPORT_HPP
Type
Definition: httptransport.hpp:40
Abstract data transport for HttpClient.
Definition: httptransport.hpp:34