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

Side by Side Diff: tools/android/forwarder2/host_controller.cc

Issue 2402793002: [Android] Add timeout to unmap reply handling. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/android/forwarder2/host_controller.h" 5 #include "tools/android/forwarder2/host_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 << ": Could not connect to device on port " 169 << ": Could not connect to device on port "
170 << adb_port_; 170 << adb_port_;
171 return; 171 return;
172 } 172 }
173 if (!SendCommand(command::UNLISTEN, device_port_, &socket)) { 173 if (!SendCommand(command::UNLISTEN, device_port_, &socket)) {
174 LOG(ERROR) << device_serial_ 174 LOG(ERROR) << device_serial_
175 << ": Could not send unmap command for port " 175 << ": Could not send unmap command for port "
176 << device_port_; 176 << device_port_;
177 return; 177 return;
178 } 178 }
179 if (!ReceivedCommand(command::UNLISTEN_SUCCESS, &socket)) { 179 if (!ReceivedCommandWithTimeout(command::UNLISTEN_SUCCESS, &socket, 10)) {
180 LOG(ERROR) << device_serial_ 180 LOG(ERROR) << device_serial_
181 << ": Unmap command failed for port " 181 << ": Unmap command failed for port "
182 << device_port_; 182 << device_port_;
183 return; 183 return;
184 } 184 }
185 } 185 }
186 186
187 } // namespace forwarder2 187 } // namespace forwarder2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698