timeout is configurable

This commit is contained in:
Benjamin Sergeant
2019-01-03 18:33:08 -08:00
parent 332bb87231
commit d75753ec98
9 changed files with 54 additions and 24 deletions

View File

@@ -26,7 +26,8 @@ namespace ix
WebSocketServer(int port = WebSocketServer::kDefaultPort,
const std::string& host = WebSocketServer::kDefaultHost,
int backlog = WebSocketServer::kDefaultTcpBacklog,
size_t maxConnections = WebSocketServer::kDefaultMaxConnections);
size_t maxConnections = WebSocketServer::kDefaultMaxConnections,
int handshakeTimeoutSecs = WebSocketServer::kDefaultHandShakeTimeoutSecs);
virtual ~WebSocketServer();
void setOnConnectionCallback(const OnConnectionCallback& callback);
@@ -45,6 +46,7 @@ namespace ix
std::string _host;
int _backlog;
size_t _maxConnections;
int _handshakeTimeoutSecs;
OnConnectionCallback _onConnectionCallback;
@@ -66,6 +68,7 @@ namespace ix
const static std::string kDefaultHost;
const static int kDefaultTcpBacklog;
const static size_t kDefaultMaxConnections;
const static int kDefaultHandShakeTimeoutSecs;
// Methods
void run();