Replies: 1 comment 3 replies
-
I updated and tested the example code in that page. It should work now. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all!
I found the two classes here: https://tango-adb.github.io/docs/tango/daemon/tcp/create-connection/
I would like to use these two classes and create wireless adb connection to Android devices. I already have the IP address and port details. When trying to implement this feature, I was not able to directly import AdbDaemonDirectSocketsDevice and TCPSocket class so I figured we need to create the class manually as shown in the doc. But there are errors when copying & pasting the code I saw several errors. For example, the below code
const readable = new PushReadableStream((controller) => { this.#socket.on('data', async (data) => { this.#socket.pause(); await controller.enqueue(data); this.#socket.resume(); });
is not assignable when sending into this.#opened.resolve()
this.#opened.resolve({ remoteAddress, remotePort, localAddress: this.#socket.localAddress!, localPort: this.#socket.localPort!, readable, writable: new WritableStream({ write: async (chunk) => { return new Promise<void>((resolve, reject) => { if (!this.#socket.write(chunk)) { this.#socket.once('drain', resolve); } else { resolve(); } }); }, close: async () => { this.#socket.end(); }, }), }); });
Any help will be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions