Allow multiple tcp adb connection to same device.

This worked before Kitkat, and then we lost this feature in Kitkat.
Now I make the register logic in server_socket_thread as same as qemu_socket_thread.

Test: manual - build emulator image and connect from different adb client.
Bug: 32341562
Change-Id: I7b4831d280048d2a3796be3522bd3b8fbc1ade6b
Signed-off-by: Tao Wu <lepton@google.com>
This commit is contained in:
Tao Wu 2016-10-21 15:43:57 -07:00
parent 955648a915
commit 043912ec11
1 changed files with 2 additions and 1 deletions

View File

@ -226,7 +226,8 @@ static void server_socket_thread(void* arg) {
D("server: new connection on fd %d", fd);
close_on_exec(fd);
disable_tcp_nagle(fd);
if (register_socket_transport(fd, "host", port, 1) != 0) {
std::string serial = android::base::StringPrintf("host-%d", fd);
if (register_socket_transport(fd, serial.c_str(), port, 1) != 0) {
adb_close(fd);
}
}