Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: remoting/host/chromoting_host.cc

Issue 3320003: Allows chromoting host to be connected again after connection drops. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/session_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 1bc7b984f2d362aacc076c16d7bc1b6fd0634042..390096c48f1b029717bbdbd9a1497b637872f309 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -76,6 +76,7 @@ void ChromotingHost::OnClientConnected(ClientConnection* client) {
} else {
// If a session manager already exists we simply add the new client.
session_->AddClient(client);
+ session_->Start();
}
}
@@ -89,6 +90,9 @@ void ChromotingHost::OnClientDisconnected(ClientConnection* client) {
session_->Pause();
}
+ // Close the connection to client just to be safe.
+ client->Disconnect();
+
// Also remove reference to ClientConnection from this object.
client_ = NULL;
}
@@ -117,7 +121,6 @@ void ChromotingHost::OnConnectionOpened(ClientConnection* client) {
void ChromotingHost::OnConnectionClosed(ClientConnection* client) {
DCHECK_EQ(context_->main_message_loop(), MessageLoop::current());
- // Completes the client connection.
LOG(INFO) << "Connection to client closed.";
OnClientDisconnected(client_.get());
}
@@ -125,7 +128,6 @@ void ChromotingHost::OnConnectionClosed(ClientConnection* client) {
void ChromotingHost::OnConnectionFailed(ClientConnection* client) {
DCHECK_EQ(context_->main_message_loop(), MessageLoop::current());
- // The client has disconnected.
LOG(ERROR) << "Connection failed unexpectedly.";
OnClientDisconnected(client_.get());
}
« no previous file with comments | « no previous file | remoting/host/session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698