summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-22 12:48:47 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-22 12:48:47 -0800
commitc6ce58b302950c743bbbcbc38da4ecf33721f82b (patch)
tree8d8d285a848b1761566a3cd8bbf3c6f359d00a26 /includes
parent4fb18f31865f9766579d7221b040b1da9c98b561 (diff)
Actually supporting client/server enforcements, as well as ping.
Diffstat (limited to 'includes')
-rw-r--r--includes/BWebSocket.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/BWebSocket.h b/includes/BWebSocket.h
index 49f8cd1..cf25684 100644
--- a/includes/BWebSocket.h
+++ b/includes/BWebSocket.h
@@ -30,17 +30,19 @@ class WebSocketWorker : public StacklessTask {
public:
virtual bool parse(Http::Request & req) { return true; }
void sendFrame(WebSocketFrame * frame) { m_sendQueue.push(frame); }
+ void enforceServer(void) throw (GeneralException);
+ void enforceClient(void) throw (GeneralException);
protected:
WebSocketWorker(IO<Handle> socket, const String & url) : m_socket(new BStream(socket)) { m_name = String("WebSocket:") + url + ":" + m_socket->getName(); }
~WebSocketWorker();
void disconnect() { m_socket->close(); }
virtual void receiveMessage(const uint8_t * msg, size_t len, bool binary) = 0;
- private:
+ virtual void Do();
+private:
void processMessage();
void processPing();
void processPong();
- const char * getName() const { return m_name.to_charp(); }
- void Do();
+ virtual const char * getName() const { return m_name.to_charp(); }
String m_name;
IO<BStream> m_socket;
enum {