跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

AndroidSocket ​

Added in: v1.9

AndroidSocket is a way to communicate with a process launched on the AndroidDevice. Use androidDevice.open() to open a socket.

Methods ​

androidSocket.close() ​

Added in: v1.9 async

Closes the socket.

androidSocket.write() ​

Added in: v1.9 async

Writes some data to the socket.

Arguments

  • data Buffer

    Data to write.

Events ​

androidSocket.on('close') ​

Added in: v1.9

Emitted when the socket is closed.

Event data

  • void

androidSocket.on('data') ​

Added in: v1.9

Emitted when data is available to read from the socket.

Event data

  • Buffer

基于 Apache 2.0 许可证发布。