@deedarb/capacitor-tcp-socket
v7.2.1
Published
A TCP Socket Plugin for capacitor
Downloads
26
Readme
capacitor-tcp-socket
A TCP Socket Plugin for capacitor
Thanks @ottimis
Install
npm install capacitor-tcp-socket
npx cap syncAPI
connect(...)
connect(options: ConnectOptions) => Promise<ConnectResult>| Param | Type |
| ------------- | --------------------------------------------------------- |
| options | ConnectOptions |
Returns: Promise<ConnectResult>
send(...)
send(options: SendOptions) => Promise<void>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | SendOptions |
read(...)
read(options: ReadOptions) => Promise<ReadResult>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | ReadOptions |
Returns: Promise<ReadResult>
disconnect(...)
disconnect(options: DisconnectOptions) => Promise<DisconnectResult>| Param | Type |
| ------------- | --------------------------------------------------------------- |
| options | DisconnectOptions |
Returns: Promise<DisconnectResult>
Interfaces
ConnectResult
| Prop | Type |
| ------------ | ------------------- |
| client | number |
ConnectOptions
| Prop | Type | Description |
| --------------- | ------------------- | ------------------------------- |
| ipAddress | string | |
| port | number | |
| timeout | number | Timeout in seconds. default: 10 |
SendOptions
| Prop | Type |
| ------------ | ------------------- |
| client | number |
| data | string |
ReadResult
| Prop | Type |
| ------------ | ------------------- |
| result | string |
ReadOptions
| Prop | Type | Description |
| --------------- | ------------------- | ------------------------------- |
| client | number | |
| expectLen | number | |
| timeout | number | timeout in seconds. default: 10 |
DisconnectResult
| Prop | Type |
| ------------ | ------------------- |
| client | number |
DisconnectOptions
| Prop | Type |
| ------------ | ------------------- |
| client | number |
