Qore DebugHandler Module Reference  0.1
DebugHandler.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* DebugHandler.qm Copyright 2013 - 2017 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // this module requires Qore 0.8.12 or better
26 
27 // require type definitions everywhere
28 // enable all warnings
29 
30 
48 namespace DebugHandler {
51 
60 
61 public:
62  public :
63  WebSocketDebugHandler dhandler;
64 
65 public:
66 
67  private :
70 
71 public:
72 
74  constructor(WebSocketDebugHandler n_handler, hash n_cx);
75 
76 
78 
80  gotMessage(string msg);
81 
82 
84 
87 
89  registered();
90 
91  };
92 
94 
108 
109 public:
110  public :
111  WebSocketDebugProgramControl debugProgram;
112  // default socket send timeout
113  //const DefaultSocketSendTimeout = 30s;
114  DebugLogger logger;
115 
116 public:
117 
119 
124 
125 
126  setLogger(*list args);
127 
128 
130  WebSocketHandler::WebSocketConnection getConnectionImpl(hash cx, hash hdr, string cid);
131 
132 
134 
158  hash handleRequest(hash cx, hash hdr, *data b);
159 
160 
161  logInfo(string fmt);
162 
163 
164  logDebug(string fmt);
165 
166 
167  logError(string fmt);
168 
169  };
170 
173 
174 public:
175  private :
176  WebSocketDebugHandler handler;
177 
178 public:
179 
181  constructor(string serverName, *HttpServer::AbstractAuthenticator auth) ;
182 
183 
185 
186 private:
187  setHandler(*HttpServer::AbstractAuthenticator auth, *list args);
188 public:
189 
190 
192  sendDataImpl(hash cx, auto data);
193 
195  broadcastDataImpl(auto data);
196 
198  WebSocketHandler getHandler();
199 
201  *string getContentType();
202  };
203 };
the main web socket debug handler class
Definition: DebugHandler.qm.dox.h:107
registered()
send welcome message to identify itself
list list(...)
gotMessage(string msg)
this method is called by the WebSocketHandler when message from the client is received ...
the DebugHandler namespace contains all the objects in the DebugHandler module
Definition: DebugHandler.qm.dox.h:49
web socket debug program control class
Definition: DebugHandler.qm.dox.h:172
connectionClosed()
this method is called by the WebSocketHandler when the connection is closed
this class represents a connection to a debug server via websocket client
Definition: DebugHandler.qm.dox.h:59
hash hash(object obj)
constructor(WebSocketDebugHandler n_handler, hash n_cx)
the constructor is called by the WebSocketHandler when a new connection is made by a websocket client...
hash cx
websocket context, cx.id is used for sending messages to particular client
Definition: DebugHandler.qm.dox.h:69