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.
Dependents: WebSocketServerTest
WebSocketConnection.h
- Committer:
- flatbird
- Date:
- 2015-03-25
- Revision:
- 1:db4114d55f83
- Parent:
- 0:a816c25e83ed
File content as of revision 1:db4114d55f83:
#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