more named constants
This commit is contained in:
parent
a11952fe22
commit
00ca7c8fb0
@ -20,7 +20,9 @@
|
|||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
{
|
{
|
||||||
|
const int WebSocketServer::kDefaultPort(8080);
|
||||||
const std::string WebSocketServer::kDefaultHost("127.0.0.1");
|
const std::string WebSocketServer::kDefaultHost("127.0.0.1");
|
||||||
|
const int WebSocketServer::kDefaultTcpBacklog(5);
|
||||||
|
|
||||||
WebSocketServer::WebSocketServer(int port, const std::string& host, int backlog) :
|
WebSocketServer::WebSocketServer(int port, const std::string& host, int backlog) :
|
||||||
_port(port),
|
_port(port),
|
||||||
|
@ -23,9 +23,9 @@ namespace ix
|
|||||||
|
|
||||||
class WebSocketServer {
|
class WebSocketServer {
|
||||||
public:
|
public:
|
||||||
WebSocketServer(int port = 8080,
|
WebSocketServer(int port = WebSocketServer::kDefaultPort,
|
||||||
const std::string& host = WebSocketServer::kDefaultHost,
|
const std::string& host = WebSocketServer::kDefaultHost,
|
||||||
int backlog = 5);
|
int backlog = WebSocketServer::kDefaultTcpBacklog);
|
||||||
virtual ~WebSocketServer();
|
virtual ~WebSocketServer();
|
||||||
|
|
||||||
void setOnConnectionCallback(const OnConnectionCallback& callback);
|
void setOnConnectionCallback(const OnConnectionCallback& callback);
|
||||||
@ -59,7 +59,9 @@ namespace ix
|
|||||||
std::condition_variable _conditionVariable;
|
std::condition_variable _conditionVariable;
|
||||||
std::mutex _conditionVariableMutex;
|
std::mutex _conditionVariableMutex;
|
||||||
|
|
||||||
|
const static int kDefaultPort;
|
||||||
const static std::string kDefaultHost;
|
const static std::string kDefaultHost;
|
||||||
|
const static int kDefaultTcpBacklog;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void run();
|
void run();
|
||||||
|
Loading…
Reference in New Issue
Block a user