-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added <max_connections> to the websocket server #40
Conversation
Signed-off-by: Nate Koenig <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-launch1 #40 +/- ##
============================================
Coverage 28.15% 28.15%
============================================
Files 3 3
Lines 721 721
============================================
Hits 203 203
Misses 518 518 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Left some minor comments.
So, if we set the max connections to 0, we basically prevent connections, right? That could come handy for the circuit runs I imagine.
ignerr << "Failed to convert port[" << elem->GetText() << "] to integer." | ||
<< std::endl; | ||
} | ||
igndbg << "Using maximum connetion count of " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: connetion → connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a30524b
@@ -374,6 +404,9 @@ void WebsocketServer::OnConnect(int _socketId) | |||
////////////////////////////////////////////////// | |||
void WebsocketServer::OnDisconnect(int _socketId) | |||
{ | |||
if (this->connections.find(_socketId) == this->connections.end()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add the comment Skip invalid sockets
here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a30524b
Signed-off-by: Nate Koenig <[email protected]>
Yeah, that's right. |
This supports setting the maximum number of websocket connections.
Signed-off-by: Nate Koenig [email protected]