Skip to content

Conversation

@AlexandreK38
Copy link
Contributor

@AlexandreK38 AlexandreK38 commented May 27, 2019

using set_ping_hanlder, set_pong_handler

@msftclas
Copy link

msftclas commented May 27, 2019

CLA assistant check
All CLA requirements met.

@AlexandreK38 AlexandreK38 changed the title add ping and pong to message handler, and optional pong timeout add ping and pong to message handler May 27, 2019
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));

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

Copy link
Contributor

@garethsb garethsb left a 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.

@AlexandreK38
Copy link
Contributor Author

AlexandreK38 commented Jun 6, 2019

Btw I added a enable_auto_pong()in the config in order to automatically answer to ping requests

Copy link
Contributor

@garethsb garethsb left a 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.

@garethsb
Copy link
Contributor

garethsb commented Jun 6, 2019

I've added some unit tests for this to garethsb@468ce71. GitHub won't let me submit a PR on your fork/branch.

@AlexandreK38
Copy link
Contributor Author

AlexandreK38 commented Jun 6, 2019

Not sure why it doesn't accept PR but anyway I added your commits :)

Copy link
Contributor

@garethsb garethsb left a 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?

@BillyONeal BillyONeal merged commit 0f45af1 into microsoft:master Jun 13, 2019
@BillyONeal
Copy link
Member

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants