-
Notifications
You must be signed in to change notification settings - Fork 7
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
OnWsClose を SoraSignalingObserver に追加する #130
Conversation
include/sora/sora_signaling.h
Outdated
@@ -226,6 +227,7 @@ class SoraSignaling : public std::enable_shared_from_this<SoraSignaling>, | |||
void SendOnSignalingMessage(SoraSignalingType type, | |||
SoraSignalingDirection direction, | |||
std::string message); | |||
void SendOnWsClose(boost::beast::websocket::close_reason& reason); |
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.
パラメータに const あった方が良さそう
src/sora_signaling.cpp
Outdated
@@ -705,6 +707,7 @@ void SoraSignaling::DoInternalDisconnect( | |||
bool ec_error = ec != boost::beast::websocket::error::closed; | |||
if (ec_error) { | |||
auto reason = self->ws_->reason(); | |||
self->SendOnWsClose(reason); |
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.
ここだと非エラーの時に SendOnWsClose が呼ばれなさそうな気がします
src/sora_signaling.cpp
Outdated
void SoraSignaling::SendOnWsClose( | ||
boost::beast::websocket::close_reason& reason) { | ||
if (auto ob = config_.observer.lock(); ob) { | ||
ob->OnWsClose(reason.code, std::string(reason.reason.c_str())); |
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::string で囲む必要は無さそう
@melpon ありがとうございます。いただいたレビューをもとに修正しました。再度ご確認いただければと思います。 |
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.
よさそう
ありがとうございます! |
WebSocket が閉じられた時の code と reason を取得できるよう OnWsClose を SoraSignalingObserver に追加します