IXWebSocket/ixwebsocket/IXWebSocketServer.h

31 lines
526 B
C
Raw Normal View History

2018-12-29 23:15:27 -08:00
/*
* IXWebSocketServer.h
* Author: Benjamin Sergeant
* Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
*/
#pragma once
#include <utility> // pair
#include <string>
#include <vector>
#include <thread>
2018-12-29 23:15:27 -08:00
namespace ix
{
class WebSocketServer {
public:
WebSocketServer(int port = 8080);
virtual ~WebSocketServer();
std::pair<bool, std::string> run();
void handleConnection(int fd);
2018-12-29 23:15:27 -08:00
private:
int _port;
std::vector<std::thread> _workers;
2018-12-29 23:15:27 -08:00
};
}