Skip to content

Commit 74bb85e

Browse files
authored
Add getters (#327)
* Add getters for IXSocketServer class * Add getters for IXHttpServer class * Add getters for IXWebSocketServer class
1 parent e66437b commit 74bb85e

6 files changed

Lines changed: 55 additions & 0 deletions

File tree

ixwebsocket/IXHttpServer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,10 @@ namespace ix
226226
200, "OK", HttpErrorCode::Ok, headers, std::string("OK"));
227227
});
228228
}
229+
230+
int HttpServer::getTimeoutSecs()
231+
{
232+
return _timeoutSecs;
233+
}
234+
229235
} // namespace ix

ixwebsocket/IXHttpServer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ namespace ix
4040

4141
void makeDebugServer();
4242

43+
int getTimeoutSecs();
4344
private:
4445
// Member variables
4546
OnConnectionCallback _onConnectionCallback;

ixwebsocket/IXSocketServer.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,4 +461,29 @@ namespace ix
461461
// so wake up the thread responsible for that
462462
_conditionVariableGC.notify_one();
463463
}
464+
465+
int SocketServer::getPort()
466+
{
467+
return _port;
468+
}
469+
470+
std::string SocketServer::getHost()
471+
{
472+
return _host;
473+
}
474+
475+
int SocketServer::getBacklog()
476+
{
477+
return _backlog;
478+
}
479+
480+
std::size_t SocketServer::getMaxConnections()
481+
{
482+
return _maxConnections;
483+
}
484+
485+
int SocketServer::getAddressFamily()
486+
{
487+
return _addressFamily;
488+
}
464489
} // namespace ix

ixwebsocket/IXSocketServer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ namespace ix
6060

6161
void setTLSOptions(const SocketTLSOptions& socketTLSOptions);
6262

63+
int getPort();
64+
std::string getHost();
65+
int getBacklog();
66+
std::size_t getMaxConnections();
67+
int getAddressFamily();
6368
protected:
6469
// Logging
6570
void logError(const std::string& str);

ixwebsocket/IXWebSocketServer.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,19 @@ namespace ix
211211
start();
212212
return true;
213213
}
214+
215+
int WebSocketServer::getHandshakeTimeoutSecs()
216+
{
217+
return _handshakeTimeoutSecs;
218+
}
219+
220+
bool WebSocketServer::isPongEnabled()
221+
{
222+
return _enablePong;
223+
}
224+
225+
bool WebSocketServer::isPerMessageDeflateEnabled()
226+
{
227+
return _enablePerMessageDeflate;
228+
}
214229
} // namespace ix

ixwebsocket/IXWebSocketServer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ namespace ix
5252

5353
const static int kDefaultHandShakeTimeoutSecs;
5454

55+
int getHandshakeTimeoutSecs();
56+
bool isPongEnabled();
57+
bool isPerMessageDeflateEnabled();
5558
private:
5659
// Member variables
5760
int _handshakeTimeoutSecs;

0 commit comments

Comments
 (0)