2011-05-30 13:39:02 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "peerconnection/samples/client/conductor.h"
|
|
|
|
|
|
|
|
#include "peerconnection/samples/client/defaults.h"
|
2011-09-06 18:31:55 +02:00
|
|
|
#include "talk/base/common.h"
|
2011-05-30 13:39:02 +02:00
|
|
|
#include "talk/base/logging.h"
|
2011-08-04 19:44:30 +02:00
|
|
|
#include "talk/p2p/client/basicportallocator.h"
|
2011-06-08 13:24:32 +02:00
|
|
|
#include "talk/session/phone/videorendererfactory.h"
|
2011-05-30 13:39:02 +02:00
|
|
|
|
2011-09-01 10:37:05 +02:00
|
|
|
namespace {
|
|
|
|
// Used when passing stream information from callback threads to the UI thread.
|
|
|
|
struct StreamInfo {
|
|
|
|
StreamInfo(const std::string& id, bool video) : id_(id), video_(video) {}
|
|
|
|
|
|
|
|
std::string id_;
|
|
|
|
bool video_;
|
|
|
|
};
|
|
|
|
} // end anonymous.
|
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
Conductor::Conductor(PeerConnectionClient* client, MainWindow* main_wnd)
|
2011-09-01 10:37:05 +02:00
|
|
|
: peer_id_(-1),
|
2011-05-30 13:39:02 +02:00
|
|
|
client_(client),
|
|
|
|
main_wnd_(main_wnd) {
|
|
|
|
client_->RegisterObserver(this);
|
|
|
|
main_wnd->RegisterObserver(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
Conductor::~Conductor() {
|
|
|
|
ASSERT(peer_connection_.get() == NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Conductor::connection_active() const {
|
|
|
|
return peer_connection_.get() != NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::Close() {
|
2011-08-25 17:03:52 +02:00
|
|
|
client_->SignOut();
|
|
|
|
DeletePeerConnection();
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Conductor::InitializePeerConnection() {
|
2011-08-25 17:03:52 +02:00
|
|
|
ASSERT(peer_connection_factory_.get() == NULL);
|
2011-05-30 13:39:02 +02:00
|
|
|
ASSERT(peer_connection_.get() == NULL);
|
2011-08-04 19:44:30 +02:00
|
|
|
ASSERT(worker_thread_.get() == NULL);
|
|
|
|
|
|
|
|
worker_thread_.reset(new talk_base::Thread());
|
2011-08-25 17:03:52 +02:00
|
|
|
if (!worker_thread_->SetName("ConductorWT", this) ||
|
2011-08-04 19:44:30 +02:00
|
|
|
!worker_thread_->Start()) {
|
2011-08-25 17:03:52 +02:00
|
|
|
LOG(LS_ERROR) << "Failed to start libjingle worker thread";
|
|
|
|
worker_thread_.reset();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
peer_connection_factory_.reset(
|
2011-12-13 20:12:46 +01:00
|
|
|
new webrtc::PeerConnectionFactory(worker_thread_.get()));
|
2011-08-25 17:03:52 +02:00
|
|
|
if (!peer_connection_factory_->Initialize()) {
|
|
|
|
main_wnd_->MessageBox("Error",
|
|
|
|
"Failed to initialize PeerConnectionFactory", true);
|
|
|
|
DeletePeerConnection();
|
|
|
|
return false;
|
2011-08-04 19:44:30 +02:00
|
|
|
}
|
|
|
|
|
2011-12-13 20:12:46 +01:00
|
|
|
port_allocator_.reset(new cricket::BasicPortAllocator(
|
|
|
|
new talk_base::BasicNetworkManager(),
|
|
|
|
talk_base::SocketAddress("stun.l.google.com", 19302),
|
|
|
|
talk_base::SocketAddress(),
|
|
|
|
talk_base::SocketAddress(),
|
|
|
|
talk_base::SocketAddress()));
|
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
// Since we only ever use a single PeerConnection instance, we share
|
|
|
|
// the worker thread between the factory and the PC instance.
|
|
|
|
peer_connection_.reset(peer_connection_factory_->CreatePeerConnection(
|
2011-12-13 20:12:46 +01:00
|
|
|
port_allocator_.get(), worker_thread_.get()));
|
2011-08-25 17:03:52 +02:00
|
|
|
if (!peer_connection_.get()) {
|
|
|
|
main_wnd_->MessageBox("Error",
|
|
|
|
"CreatePeerConnection failed", true);
|
2011-05-30 13:39:02 +02:00
|
|
|
DeletePeerConnection();
|
|
|
|
} else {
|
2011-08-25 17:03:52 +02:00
|
|
|
peer_connection_->RegisterObserver(this);
|
2011-05-30 13:39:02 +02:00
|
|
|
bool audio = peer_connection_->SetAudioDevice("", "", 0);
|
|
|
|
LOG(INFO) << "SetAudioDevice " << (audio ? "succeeded." : "failed.");
|
|
|
|
}
|
|
|
|
return peer_connection_.get() != NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::DeletePeerConnection() {
|
|
|
|
peer_connection_.reset();
|
2011-09-01 10:37:05 +02:00
|
|
|
active_streams_.clear();
|
2011-12-13 20:12:46 +01:00
|
|
|
port_allocator_.reset();
|
2011-08-25 17:03:52 +02:00
|
|
|
peer_connection_factory_.reset();
|
2011-12-13 20:12:46 +01:00
|
|
|
worker_thread_.reset();
|
2011-08-25 17:03:52 +02:00
|
|
|
peer_id_ = -1;
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
2011-10-03 17:59:40 +02:00
|
|
|
void Conductor::SwitchToStreamingUi() {
|
2011-08-25 17:03:52 +02:00
|
|
|
ASSERT(peer_connection_.get() != NULL);
|
2011-05-30 13:39:02 +02:00
|
|
|
if (main_wnd_->IsWindow()) {
|
2011-08-25 17:03:52 +02:00
|
|
|
if (main_wnd_->current_ui() != MainWindow::STREAMING)
|
|
|
|
main_wnd_->SwitchToStreamingUI();
|
2011-05-30 13:39:02 +02:00
|
|
|
|
|
|
|
if (peer_connection_->SetVideoCapture("")) {
|
2011-07-04 14:47:37 +02:00
|
|
|
peer_connection_->SetLocalVideoRenderer(main_wnd_->local_renderer());
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// PeerConnectionObserver implementation.
|
|
|
|
//
|
|
|
|
|
|
|
|
void Conductor::OnError() {
|
2011-08-25 17:03:52 +02:00
|
|
|
LOG(LS_ERROR) << __FUNCTION__;
|
|
|
|
main_wnd_->QueueUIThreadCallback(PEER_CONNECTION_ERROR, NULL);
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::OnSignalingMessage(const std::string& msg) {
|
|
|
|
LOG(INFO) << __FUNCTION__;
|
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
std::string* msg_copy = new std::string(msg);
|
|
|
|
main_wnd_->QueueUIThreadCallback(SEND_MESSAGE_TO_PEER, msg_copy);
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Called when a remote stream is added
|
2011-08-04 19:44:30 +02:00
|
|
|
void Conductor::OnAddStream(const std::string& stream_id, bool video) {
|
2011-05-30 13:39:02 +02:00
|
|
|
LOG(INFO) << __FUNCTION__ << " " << stream_id;
|
2011-08-30 19:16:35 +02:00
|
|
|
|
2011-09-01 10:37:05 +02:00
|
|
|
main_wnd_->QueueUIThreadCallback(NEW_STREAM_ADDED,
|
|
|
|
new StreamInfo(stream_id, video));
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
2011-08-04 19:44:30 +02:00
|
|
|
void Conductor::OnRemoveStream(const std::string& stream_id, bool video) {
|
2011-08-25 17:03:52 +02:00
|
|
|
LOG(INFO) << __FUNCTION__ << (video ? " video: " : " audio: ") << stream_id;
|
|
|
|
|
2011-09-01 10:37:05 +02:00
|
|
|
main_wnd_->QueueUIThreadCallback(STREAM_REMOVED,
|
|
|
|
new StreamInfo(stream_id, video));
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// PeerConnectionClientObserver implementation.
|
|
|
|
//
|
|
|
|
|
|
|
|
void Conductor::OnSignedIn() {
|
|
|
|
LOG(INFO) << __FUNCTION__;
|
|
|
|
main_wnd_->SwitchToPeerList(client_->peers());
|
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::OnDisconnected() {
|
|
|
|
LOG(INFO) << __FUNCTION__;
|
2011-08-25 17:03:52 +02:00
|
|
|
|
|
|
|
DeletePeerConnection();
|
|
|
|
|
|
|
|
if (main_wnd_->IsWindow())
|
2011-05-30 13:39:02 +02:00
|
|
|
main_wnd_->SwitchToConnectUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::OnPeerConnected(int id, const std::string& name) {
|
|
|
|
LOG(INFO) << __FUNCTION__;
|
|
|
|
// Refresh the list if we're showing it.
|
2011-08-25 17:03:52 +02:00
|
|
|
if (main_wnd_->current_ui() == MainWindow::LIST_PEERS)
|
2011-05-30 13:39:02 +02:00
|
|
|
main_wnd_->SwitchToPeerList(client_->peers());
|
|
|
|
}
|
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
void Conductor::OnPeerDisconnected(int id) {
|
2011-05-30 13:39:02 +02:00
|
|
|
LOG(INFO) << __FUNCTION__;
|
|
|
|
if (id == peer_id_) {
|
|
|
|
LOG(INFO) << "Our peer disconnected";
|
2011-08-25 17:03:52 +02:00
|
|
|
main_wnd_->QueueUIThreadCallback(PEER_CONNECTION_CLOSED, NULL);
|
|
|
|
} else {
|
|
|
|
// Refresh the list if we're showing it.
|
|
|
|
if (main_wnd_->current_ui() == MainWindow::LIST_PEERS)
|
|
|
|
main_wnd_->SwitchToPeerList(client_->peers());
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::OnMessageFromPeer(int peer_id, const std::string& message) {
|
|
|
|
ASSERT(peer_id_ == peer_id || peer_id_ == -1);
|
2011-08-25 17:03:52 +02:00
|
|
|
ASSERT(!message.empty());
|
2011-05-30 13:39:02 +02:00
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
if (!peer_connection_.get()) {
|
|
|
|
ASSERT(peer_id_ == -1);
|
2011-05-30 13:39:02 +02:00
|
|
|
peer_id_ = peer_id;
|
2011-08-25 17:03:52 +02:00
|
|
|
|
|
|
|
// Got an offer. Give it to the PeerConnection instance.
|
|
|
|
// Once processed, we will get a callback to OnSignalingMessage with
|
|
|
|
// our 'answer' which we'll send to the peer.
|
|
|
|
LOG(INFO) << "Got an offer from our peer: " << peer_id;
|
|
|
|
if (!InitializePeerConnection()) {
|
|
|
|
LOG(LS_ERROR) << "Failed to initialize our PeerConnection instance";
|
|
|
|
client_->SignOut();
|
|
|
|
return;
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
2011-08-25 17:03:52 +02:00
|
|
|
} else if (peer_id != peer_id_) {
|
|
|
|
ASSERT(peer_id_ != -1);
|
|
|
|
LOG(WARNING) << "Received an offer from a peer while already in a "
|
|
|
|
"conversation with a different peer.";
|
|
|
|
return;
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
peer_connection_->SignalingMessage(message);
|
2011-08-25 17:03:52 +02:00
|
|
|
}
|
2011-05-30 13:39:02 +02:00
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
void Conductor::OnMessageSent(int err) {
|
|
|
|
// Process the next pending message if any.
|
|
|
|
main_wnd_->QueueUIThreadCallback(SEND_MESSAGE_TO_PEER, NULL);
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// MainWndCallback implementation.
|
|
|
|
//
|
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
bool Conductor::StartLogin(const std::string& server, int port) {
|
|
|
|
if (client_->is_connected())
|
|
|
|
return false;
|
|
|
|
|
2011-05-30 13:39:02 +02:00
|
|
|
if (!client_->Connect(server, port, GetPeerName())) {
|
2011-08-25 17:03:52 +02:00
|
|
|
main_wnd_->MessageBox("Error", ("Failed to connect to " + server).c_str(),
|
|
|
|
true);
|
|
|
|
return false;
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
2011-08-25 17:03:52 +02:00
|
|
|
|
|
|
|
return true;
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::DisconnectFromServer() {
|
2011-08-25 17:03:52 +02:00
|
|
|
if (client_->is_connected())
|
|
|
|
client_->SignOut();
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Conductor::ConnectToPeer(int peer_id) {
|
|
|
|
ASSERT(peer_id_ == -1);
|
|
|
|
ASSERT(peer_id != -1);
|
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
if (peer_connection_.get()) {
|
|
|
|
main_wnd_->MessageBox("Error",
|
|
|
|
"We only support connecting to one peer at a time", true);
|
2011-05-30 13:39:02 +02:00
|
|
|
return;
|
2011-08-25 17:03:52 +02:00
|
|
|
}
|
2011-05-30 13:39:02 +02:00
|
|
|
|
|
|
|
if (InitializePeerConnection()) {
|
|
|
|
peer_id_ = peer_id;
|
2011-08-25 17:03:52 +02:00
|
|
|
main_wnd_->SwitchToStreamingUI();
|
2011-10-03 17:59:40 +02:00
|
|
|
SwitchToStreamingUi();
|
2011-08-30 19:16:35 +02:00
|
|
|
AddStreams();
|
2011-08-04 19:44:30 +02:00
|
|
|
} else {
|
2011-08-25 17:03:52 +02:00
|
|
|
main_wnd_->MessageBox("Error", "Failed to initialize PeerConnection", true);
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-01 10:37:05 +02:00
|
|
|
bool Conductor::AddStream(const std::string& id, bool video) {
|
|
|
|
// NOTE: Must be called from the UI thread.
|
|
|
|
if (active_streams_.find(id) != active_streams_.end())
|
|
|
|
return false; // Already added.
|
|
|
|
|
|
|
|
active_streams_.insert(id);
|
|
|
|
bool ret = peer_connection_->AddStream(id, video);
|
|
|
|
if (!ret) {
|
|
|
|
active_streams_.erase(id);
|
|
|
|
} else if (video) {
|
|
|
|
LOG(INFO) << "Setting video renderer for stream: " << id;
|
|
|
|
bool ok = peer_connection_->SetVideoRenderer(id,
|
|
|
|
main_wnd_->remote_renderer());
|
|
|
|
ASSERT(ok);
|
2011-09-06 18:31:55 +02:00
|
|
|
UNUSED(ok);
|
2011-09-01 10:37:05 +02:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2011-08-25 17:03:52 +02:00
|
|
|
|
2011-09-01 10:37:05 +02:00
|
|
|
void Conductor::AddStreams() {
|
|
|
|
int streams = 0;
|
|
|
|
if (AddStream(kVideoLabel, true))
|
|
|
|
++streams;
|
2011-08-04 19:44:30 +02:00
|
|
|
|
2011-09-01 10:37:05 +02:00
|
|
|
if (AddStream(kAudioLabel, false))
|
|
|
|
++streams;
|
2011-08-30 19:16:35 +02:00
|
|
|
|
|
|
|
// At the initiator of the call, after adding streams we need
|
|
|
|
// kick start the ICE candidates discovery process, which
|
|
|
|
// is done by the Connect method. Earlier this was done after
|
|
|
|
// getting the OnLocalStreamInitialized callback which is removed
|
|
|
|
// now. Connect will trigger OnSignalingMessage callback when
|
|
|
|
// ICE candidates are available.
|
2011-09-01 10:37:05 +02:00
|
|
|
if (streams)
|
2011-08-30 19:16:35 +02:00
|
|
|
peer_connection_->Connect();
|
2011-08-04 19:44:30 +02:00
|
|
|
}
|
|
|
|
|
2011-05-30 13:39:02 +02:00
|
|
|
void Conductor::DisconnectFromCurrentPeer() {
|
2011-08-25 17:03:52 +02:00
|
|
|
LOG(INFO) << __FUNCTION__;
|
2011-08-26 15:20:41 +02:00
|
|
|
if (peer_connection_.get()) {
|
|
|
|
client_->SendHangUp(peer_id_);
|
2011-08-25 17:03:52 +02:00
|
|
|
DeletePeerConnection();
|
2011-08-26 15:20:41 +02:00
|
|
|
}
|
2011-05-30 13:39:02 +02:00
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
if (main_wnd_->IsWindow())
|
|
|
|
main_wnd_->SwitchToPeerList(client_->peers());
|
|
|
|
}
|
2011-05-30 13:39:02 +02:00
|
|
|
|
2011-08-25 17:03:52 +02:00
|
|
|
void Conductor::UIThreadCallback(int msg_id, void* data) {
|
2011-09-01 10:37:05 +02:00
|
|
|
switch (msg_id) {
|
|
|
|
case PEER_CONNECTION_CLOSED:
|
|
|
|
LOG(INFO) << "PEER_CONNECTION_CLOSED";
|
|
|
|
DeletePeerConnection();
|
|
|
|
|
|
|
|
ASSERT(active_streams_.empty());
|
|
|
|
|
|
|
|
if (main_wnd_->IsWindow()) {
|
|
|
|
if (client_->is_connected()) {
|
|
|
|
main_wnd_->SwitchToPeerList(client_->peers());
|
|
|
|
} else {
|
|
|
|
main_wnd_->SwitchToConnectUI();
|
|
|
|
}
|
2011-05-30 13:39:02 +02:00
|
|
|
} else {
|
2011-09-01 10:37:05 +02:00
|
|
|
DisconnectFromServer();
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
2011-09-01 10:37:05 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SEND_MESSAGE_TO_PEER: {
|
|
|
|
LOG(INFO) << "SEND_MESSAGE_TO_PEER";
|
|
|
|
std::string* msg = reinterpret_cast<std::string*>(data);
|
2011-10-10 10:16:26 +02:00
|
|
|
if (msg) {
|
|
|
|
// For convenience, we always run the message through the queue.
|
|
|
|
// This way we can be sure that messages are sent to the server
|
|
|
|
// in the same order they were signaled without much hassle.
|
2011-09-01 10:37:05 +02:00
|
|
|
pending_messages_.push_back(msg);
|
2011-10-10 10:16:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!pending_messages_.empty() && !client_->IsSendingMessage()) {
|
|
|
|
msg = pending_messages_.front();
|
|
|
|
pending_messages_.pop_front();
|
|
|
|
|
|
|
|
if (!client_->SendToPeer(peer_id_, *msg) && peer_id_ != -1) {
|
|
|
|
LOG(LS_ERROR) << "SendToPeer failed";
|
|
|
|
DisconnectFromServer();
|
2011-09-01 10:37:05 +02:00
|
|
|
}
|
|
|
|
|
2011-10-10 10:16:26 +02:00
|
|
|
delete msg;
|
2011-09-01 10:37:05 +02:00
|
|
|
}
|
2011-10-10 10:16:26 +02:00
|
|
|
|
|
|
|
if (!peer_connection_.get())
|
|
|
|
peer_id_ = -1;
|
2011-09-01 10:37:05 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case PEER_CONNECTION_ADDSTREAMS:
|
|
|
|
AddStreams();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PEER_CONNECTION_ERROR:
|
|
|
|
main_wnd_->MessageBox("Error", "an unknown error occurred", true);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NEW_STREAM_ADDED: {
|
|
|
|
talk_base::scoped_ptr<StreamInfo> info(
|
|
|
|
reinterpret_cast<StreamInfo*>(data));
|
|
|
|
if (info->video_) {
|
|
|
|
LOG(INFO) << "Setting video renderer for stream: " << info->id_;
|
|
|
|
bool ok = peer_connection_->SetVideoRenderer(info->id_,
|
|
|
|
main_wnd_->remote_renderer());
|
|
|
|
ASSERT(ok);
|
|
|
|
if (!ok)
|
|
|
|
LOG(LS_ERROR) << "SetVideoRenderer failed for : " << info->id_;
|
|
|
|
|
|
|
|
// TODO(tommi): For the initiator, we shouldn't have to make this call
|
|
|
|
// here (which is actually the second time this is called for the
|
|
|
|
// initiator). Look into why this is needed.
|
2011-10-03 17:59:40 +02:00
|
|
|
SwitchToStreamingUi();
|
2011-08-25 17:03:52 +02:00
|
|
|
}
|
|
|
|
|
2011-09-01 10:37:05 +02:00
|
|
|
// If we haven't shared any streams with this peer (we're the receiver)
|
|
|
|
// then do so now.
|
|
|
|
if (active_streams_.empty())
|
|
|
|
AddStreams();
|
|
|
|
break;
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
2011-09-01 10:37:05 +02:00
|
|
|
|
|
|
|
case STREAM_REMOVED: {
|
|
|
|
talk_base::scoped_ptr<StreamInfo> info(
|
|
|
|
reinterpret_cast<StreamInfo*>(data));
|
|
|
|
active_streams_.erase(info->id_);
|
|
|
|
if (active_streams_.empty()) {
|
|
|
|
LOG(INFO) << "All streams have been closed.";
|
|
|
|
main_wnd_->QueueUIThreadCallback(PEER_CONNECTION_CLOSED, NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
ASSERT(false);
|
|
|
|
break;
|
2011-05-30 13:39:02 +02:00
|
|
|
}
|
|
|
|
}
|