capacitor-tcp-socket
A TCP Socket Plugin for capacitor
Thanks @ottimis
Install
npm install capacitor-tcp-socket
npx cap sync
API
connect(...)
connect(options: ConnectOptions) => Promise<ConnectResult>
Returns: Promise<ConnectResult>
send(...)
send(options: SendOptions) => Promise<void>
read(...)
read(options: ReadOptions) => Promise<ReadResult>
Returns: Promise<ReadResult>
disconnect(...)
disconnect(options: DisconnectOptions) => Promise<DisconnectResult>
Returns: Promise<DisconnectResult>
Interfaces
ConnectResult
ConnectOptions
Prop | Type |
---|
ipAddress | string |
port | number |
SendOptions
Prop | Type |
---|
client | number |
data | string |
ReadResult
ReadOptions
Prop | Type | Description |
---|
client | number | |
expectLen | number | |
timeout | number | timeout in seconds. default: 10 only ios supports timeout. |
DisconnectResult
DisconnectOptions