TreeFrogFramework  1.18
tapplicationserverbase.h
Go to the documentation of this file.
1 #ifndef TAPPLICATIONSERVERBASE_H
2 #define TAPPLICATIONSERVERBASE_H
3 
4 #include <QHostAddress>
5 #include <TGlobal>
6 
7 #ifdef Q_OS_UNIX
8 # include <tfcore_unix.h>
9 #endif
10 
11 
13 {
14 public:
15  enum OpenFlag {
16  CloseOnExec = 0,
18  };
19 
20  virtual ~TApplicationServerBase();
21  virtual bool start(bool) { return false; }
22  virtual void stop() { }
23  virtual void setAutoReloadingEnabled(bool) { }
24  virtual bool isAutoReloadingEnabled() { return false; }
25 
26  static bool loadLibraries();
27  static void unloadLibraries();
28  static QDateTime latestLibraryTimestamp();
29  static bool newerLibraryExists();
30  static void nativeSocketInit();
31  static void nativeSocketCleanup();
32  static int nativeListen(const QHostAddress &address, quint16 port, OpenFlag flag = CloseOnExec);
33  static int nativeListen(const QString &fileDomain, OpenFlag flag = CloseOnExec);
34  static void nativeClose(int socket);
35  static QPair<QHostAddress, quint16> getPeerInfo(int socketDescriptor);
36  static int duplicateSocket(int socketDescriptor);
37  static void invokeStaticInitialize();
38  static void invokeStaticRelease();
39 
40 private:
42 
43  friend class TThreadApplicationServer;
44  friend class TMultiplexingServer;
47 };
48 
49 #endif // TAPPLICATIONSERVERBASE_H
#define T_CORE_EXPORT
Definition: tglobal.h:81
The TApplicationServerBase class provides functionality common to an web application server...
Definition: tapplicationserverbase.h:12
virtual bool isAutoReloadingEnabled()
Definition: tapplicationserverbase.h:24
OpenFlag
Definition: tapplicationserverbase.h:15
virtual void setAutoReloadingEnabled(bool)
Definition: tapplicationserverbase.h:23
#define T_DISABLE_COPY(Class)
Definition: tglobal.h:137
#define T_DISABLE_MOVE(Class)
Definition: tglobal.h:141
virtual void stop()
Definition: tapplicationserverbase.h:22
virtual bool start(bool)
Definition: tapplicationserverbase.h:21
Definition: tapplicationserverbase.h:17