-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add ping and pong to message handler #1143
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
Conversation
| incoming_msg.m_msg_type = websocket_message_type::ping; | ||
| incoming_msg.m_body = concurrency::streams::container_buffer<std::string>(msg); | ||
| // 'move' the payload into a container buffer to avoid any copies. | ||
| incoming_msg.m_body = concurrency::streams::container_buffer<std::string>(std::move(msg)); |
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.
std::move is redundant here. Compiler will ignore it because msg is const ref. To use std::move the msg should be &&:
std::string&& msg
garethsb
left a comment
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.
Looks good at first review, I'll try to test soon.
|
Btw I added a |
garethsb
left a comment
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.
Thanks for the quick updates. A few comments on latest changes.
|
I've added some unit tests for this to garethsb@468ce71. GitHub won't let me submit a PR on your fork/branch. |
|
Not sure why it doesn't accept PR but anyway I added your commits :) |
garethsb
left a comment
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. @BillyONeal would you be able to review this?
|
Thanks for your contribution! |
using
set_ping_hanlder,set_pong_handler