Skip to content

Commit

Permalink
hello ではなく、 datachannel に OnSwitched を実装する & datachannel が安定しなかったので e…
Browse files Browse the repository at this point in the history
…xpires_from_now の値を伸ばす
  • Loading branch information
enm10k committed Feb 19, 2024
1 parent c02cce7 commit 695a0e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 4 additions & 1 deletion test/datachannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class SoraClient : public std::enable_shared_from_this<SoraClient>,
[this](const boost::system::error_code&, int) { conn_->Disconnect(); });

timer_.reset(new boost::asio::deadline_timer(*ioc_));
timer_->expires_from_now(boost::posix_time::seconds(1));
timer_->expires_from_now(boost::posix_time::seconds(3));
timer_->async_wait([this, labels](boost::system::error_code ec) {
if (ec) {
return;
Expand Down Expand Up @@ -100,6 +100,9 @@ class SoraClient : public std::enable_shared_from_this<SoraClient>,
void OnNotify(std::string text) override {}
void OnPush(std::string text) override {}
void OnMessage(std::string label, std::string data) override {}
void OnSwitched(std::string text) override {
RTC_LOG(LS_INFO) << "OnSwitched: " << text;
}

void OnTrack(rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver)
override {}
Expand Down
3 changes: 0 additions & 3 deletions test/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ void HelloSora::OnDisconnect(sora::SoraSignalingErrorCode ec,
RTC_LOG(LS_INFO) << "OnDisconnect: " << message;
ioc_->stop();
}
void HelloSora::OnSwitched(std::string text) {
RTC_LOG(LS_INFO) << "OnSwitched: " << text;
}

#if defined(__ANDROID__) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)

Expand Down
1 change: 0 additions & 1 deletion test/hello.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class HelloSora : public std::enable_shared_from_this<HelloSora>,
void OnNotify(std::string text) override {}
void OnPush(std::string text) override {}
void OnMessage(std::string label, std::string data) override {}
void OnSwitched(std::string text) override;

void OnTrack(rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver)
override {}
Expand Down

0 comments on commit 695a0e1

Please sign in to comment.