Loading libraries/adb/src/daemon/dispatcher.ts +2 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ export interface AdbPacketDispatcherOptions { * Whether to preserve the connection open after the `AdbPacketDispatcher` is closed. */ preserveConnection?: boolean | undefined; debugSlowRead?: boolean | undefined; } /** Loading Loading @@ -229,7 +230,7 @@ export class AdbPacketDispatcher implements Closeable { let handled = false; await Promise.race([ delay(5000).then(() => { if (!handled) { if (this.options.debugSlowRead && !handled) { throw new Error( `packet for \`${socket.service}\` not handled in 5 seconds`, ); Loading libraries/adb/src/daemon/transport.ts +7 −9 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ interface AdbDaemonAuthenticationOptions { * Whether to preserve the connection open after the `AdbDaemonTransport` is closed. */ preserveConnection?: boolean | undefined; debugSlowRead?: boolean | undefined; } interface AdbDaemonSocketConnectorConstructionOptions { Loading @@ -53,6 +54,7 @@ interface AdbDaemonSocketConnectorConstructionOptions { * Whether to preserve the connection open after the `AdbDaemonTransport` is closed. */ preserveConnection?: boolean | undefined; debugSlowRead?: boolean | undefined; } export class AdbDaemonTransport implements AdbTransport { Loading @@ -69,7 +71,7 @@ export class AdbDaemonTransport implements AdbTransport { connection, credentialStore, authenticators = ADB_DEFAULT_AUTHENTICATORS, preserveConnection, ...options }: AdbDaemonAuthenticationOptions): Promise<AdbDaemonTransport> { // Initially, set to highest-supported version and payload size. let version = 0x01000001; Loading Loading @@ -193,7 +195,7 @@ export class AdbDaemonTransport implements AdbTransport { version, maxPayloadSize, banner, preserveConnection, ...options, }); } Loading @@ -214,9 +216,8 @@ export class AdbDaemonTransport implements AdbTransport { return this.#protocolVersion; } #maxPayloadSize: number; get maxPayloadSize() { return this.#maxPayloadSize; return this.#dispatcher.options.maxPayloadSize; } #banner: AdbBanner; Loading @@ -232,9 +233,8 @@ export class AdbDaemonTransport implements AdbTransport { serial, connection, version, maxPayloadSize, banner, preserveConnection, ...options }: AdbDaemonSocketConnectorConstructionOptions) { this.#serial = serial; this.#connection = connection; Loading @@ -253,12 +253,10 @@ export class AdbDaemonTransport implements AdbTransport { this.#dispatcher = new AdbPacketDispatcher(connection, { calculateChecksum, appendNullToServiceString, maxPayloadSize, preserveConnection, ...options, }); this.#protocolVersion = version; this.#maxPayloadSize = maxPayloadSize; } connect(service: string): ValueOrPromise<AdbSocket> { Loading Loading
libraries/adb/src/daemon/dispatcher.ts +2 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ export interface AdbPacketDispatcherOptions { * Whether to preserve the connection open after the `AdbPacketDispatcher` is closed. */ preserveConnection?: boolean | undefined; debugSlowRead?: boolean | undefined; } /** Loading Loading @@ -229,7 +230,7 @@ export class AdbPacketDispatcher implements Closeable { let handled = false; await Promise.race([ delay(5000).then(() => { if (!handled) { if (this.options.debugSlowRead && !handled) { throw new Error( `packet for \`${socket.service}\` not handled in 5 seconds`, ); Loading
libraries/adb/src/daemon/transport.ts +7 −9 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ interface AdbDaemonAuthenticationOptions { * Whether to preserve the connection open after the `AdbDaemonTransport` is closed. */ preserveConnection?: boolean | undefined; debugSlowRead?: boolean | undefined; } interface AdbDaemonSocketConnectorConstructionOptions { Loading @@ -53,6 +54,7 @@ interface AdbDaemonSocketConnectorConstructionOptions { * Whether to preserve the connection open after the `AdbDaemonTransport` is closed. */ preserveConnection?: boolean | undefined; debugSlowRead?: boolean | undefined; } export class AdbDaemonTransport implements AdbTransport { Loading @@ -69,7 +71,7 @@ export class AdbDaemonTransport implements AdbTransport { connection, credentialStore, authenticators = ADB_DEFAULT_AUTHENTICATORS, preserveConnection, ...options }: AdbDaemonAuthenticationOptions): Promise<AdbDaemonTransport> { // Initially, set to highest-supported version and payload size. let version = 0x01000001; Loading Loading @@ -193,7 +195,7 @@ export class AdbDaemonTransport implements AdbTransport { version, maxPayloadSize, banner, preserveConnection, ...options, }); } Loading @@ -214,9 +216,8 @@ export class AdbDaemonTransport implements AdbTransport { return this.#protocolVersion; } #maxPayloadSize: number; get maxPayloadSize() { return this.#maxPayloadSize; return this.#dispatcher.options.maxPayloadSize; } #banner: AdbBanner; Loading @@ -232,9 +233,8 @@ export class AdbDaemonTransport implements AdbTransport { serial, connection, version, maxPayloadSize, banner, preserveConnection, ...options }: AdbDaemonSocketConnectorConstructionOptions) { this.#serial = serial; this.#connection = connection; Loading @@ -253,12 +253,10 @@ export class AdbDaemonTransport implements AdbTransport { this.#dispatcher = new AdbPacketDispatcher(connection, { calculateChecksum, appendNullToServiceString, maxPayloadSize, preserveConnection, ...options, }); this.#protocolVersion = version; this.#maxPayloadSize = maxPayloadSize; } connect(service: string): ValueOrPromise<AdbSocket> { Loading