Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SNICInterface_mod WebSocketServer mbed-rtos mbed PowerControl C12832
Diff: WebSocketConnection.h
- Revision:
- 10:578778037efb
diff -r 774f408b9740 -r 578778037efb WebSocketConnection.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/WebSocketConnection.h Mon Mar 16 18:48:50 2015 +0900
@@ -0,0 +1,31 @@
+#ifndef _WEB_SOCKET_CONNECTION_H_
+#define _WEB_SOCKET_CONNECTION_H_
+
+#include "TCPSocketServer.h"
+#include "WebSocketHandler.h"
+#include <string>
+#include <map>
+
+class WebSocketServer;
+
+class WebSocketConnection
+{
+public:
+ WebSocketConnection(WebSocketServer* server);
+ virtual ~WebSocketConnection();
+
+ void run();
+ TCPSocketConnection& getTCPSocketConnection() { return mConnection; }
+
+private:
+ bool handleHTTP(char* buf, int size);
+ bool handleWebSocket(char* buf, int size);
+ bool sendUpgradeResponse(char* key);
+
+ WebSocketServer* mServer;
+ TCPSocketConnection mConnection;
+ WebSocketHandler* mHandler;
+ bool mPrevFin;
+};
+
+#endif