summaryrefslogtreecommitdiffstats
path: root/tools/android/forwarder2/device_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/android/forwarder2/device_controller.cc')
-rw-r--r--tools/android/forwarder2/device_controller.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/android/forwarder2/device_controller.cc b/tools/android/forwarder2/device_controller.cc
index 7338d5a..e9ce9cb 100644
--- a/tools/android/forwarder2/device_controller.cc
+++ b/tools/android/forwarder2/device_controller.cc
@@ -118,6 +118,17 @@ void DeviceController::Start() {
continue;
}
break;
+ case command::UNMAP_PORT:
+ if (!listener) {
+ SendCommand(command::UNMAP_PORT_ERROR, port, socket.get());
+ break;
+ }
+ listener->ForceExit();
+ listener->Join();
+ CHECK(!listener->is_alive());
+ listeners_.Remove(port);
+ SendCommand(command::UNMAP_PORT_SUCCESS, port, socket.get());
+ break;
default:
// TODO(felipeg): add a KillAllListeners command.
LOG(ERROR) << "Invalid command received. Port: " << port