ReplicaNet and RNLobby  1
UtilityServer.h
1 /* START_LICENSE_HEADER
2 
3 Copyright (C) 2000 Martin Piper, original design and program code
4 Copyright (C) 2001 Replica Software
5 
6 This program file is copyright (C) Replica Software and can only be used under license.
7 For more information visit: http://www.replicanet.com/
8 Or email: info@replicanet.com
9 
10 END_LICENSE_HEADER */
11 #include "RNPlatform/Inc/MemoryTracking.h"
12 #ifndef _UTILITYSERVER_H_
13 #define _UTILITYSERVER_H_
14 #include "RNPlatform/Inc/ThreadClass.h"
15 #include "RNPlatform/Inc/Thread.h"
16 #include "RNLobby/Inc/RNLobby.h"
17 #include "RNXPSockets/Inc/XPSocketClass.h"
18 #include "RNODBCSQL/Inc/ODBCSQL.h"
19 #include "RNLog/Inc/Log.h"
20 #include "RNWeb/Inc/Daemon.h"
21 #include "RNWeb/Inc/Worker.h"
22 #include <list>
23 
24 namespace RNReplicaNet
25 {
26 
27 namespace RNLobby
28 {
29 
30 class UtilityServerWorker;
31 
33 class UtilityServer : public RNWeb::Daemon
34 {
35 public:
36  UtilityServer(const char *lobbyDSN = MRNLobbyDefaultDSN);
37  virtual ~UtilityServer();
38 
39  enum
40  {
41  kDefaultPort = 2000
42  };
43 
44  bool Start(const XPAddress &address = XPAddress(kDefaultPort))
45  {
46  return RNWeb::Daemon::Start(address);
47  }
48 
49  virtual RNWeb::Worker *CreateWorker(XPSocket *accepted);
50 
51 private:
52 friend class UtilityServerWorker;
53  RNReplicaNet::RNLog::Log mLog;
54 
55  RNODBCSQL::ODBCSQL mWrite;
56  RNODBCSQL::ODBCSQL mRead;
57 };
58 
59 } // namespace RNLobby
60 
61 } // namespace RNReplicaNet
62 
63 #endif
Definition: XPSocket.h:91
Definition: XPSocketClass.h:28
Handles requests for utility functions using RESTful HTTP. This is not a client visible server hence ...
Definition: UtilityServer.h:33