add ping and pong to message handler#1143
add ping and pong to message handler#1143BillyONeal merged 17 commits intomicrosoft:masterfrom AlexandreK38:ping-pong
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.
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.
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.
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.
LGTM. @BillyONeal would you be able to review this?
|
Thanks for your contribution! |
using
set_ping_hanlder,set_pong_handler