Merge "adb: search for a maximum of 16 emulators." into nyc-dev
This commit is contained in:
commit
72e47300fb
1 changed files with 9 additions and 4 deletions
|
|
@ -37,14 +37,19 @@
|
||||||
#include "adb_utils.h"
|
#include "adb_utils.h"
|
||||||
|
|
||||||
#if ADB_HOST
|
#if ADB_HOST
|
||||||
|
|
||||||
|
// Android Wear has been using port 5601 in all of its documentation/tooling,
|
||||||
|
// but we search for emulators on ports [5554, 5555 + ADB_LOCAL_TRANSPORT_MAX].
|
||||||
|
// Avoid stomping on their port by limiting the number of emulators that can be
|
||||||
|
// connected.
|
||||||
|
#define ADB_LOCAL_TRANSPORT_MAX 16
|
||||||
|
|
||||||
|
ADB_MUTEX_DEFINE(local_transports_lock);
|
||||||
|
|
||||||
/* we keep a list of opened transports. The atransport struct knows to which
|
/* we keep a list of opened transports. The atransport struct knows to which
|
||||||
* local transport it is connected. The list is used to detect when we're
|
* local transport it is connected. The list is used to detect when we're
|
||||||
* trying to connect twice to a given local transport.
|
* trying to connect twice to a given local transport.
|
||||||
*/
|
*/
|
||||||
#define ADB_LOCAL_TRANSPORT_MAX 64
|
|
||||||
|
|
||||||
ADB_MUTEX_DEFINE( local_transports_lock );
|
|
||||||
|
|
||||||
static atransport* local_transports[ ADB_LOCAL_TRANSPORT_MAX ];
|
static atransport* local_transports[ ADB_LOCAL_TRANSPORT_MAX ];
|
||||||
#endif /* ADB_HOST */
|
#endif /* ADB_HOST */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue