(snake) add an option to disable answering pongs as response to pings, to test cobra client behavior with hanged connections

This commit is contained in:
Benjamin Sergeant
2020-01-31 16:55:54 -08:00
parent f994a41845
commit 5f6c54bb90
6 changed files with 23 additions and 3 deletions

View File

@ -32,6 +32,7 @@ namespace snake
// Misc
bool verbose;
bool disablePong;
};
bool isAppKeyValid(const AppConfig& appConfig, std::string appkey);

View File

@ -21,6 +21,15 @@ namespace snake
, _server(appConfig.port, appConfig.hostname)
{
_server.setTLSOptions(appConfig.socketTLSOptions);
if (appConfig.disablePong)
{
_server.disablePong();
}
std::stringstream ss;
ss << "Listening on " << appConfig.hostname << ":" << appConfig.port;
ix::IXCoreLogger::Log(ss.str().c_str());
}
//