UDPSocket.onError
js
UDPSocket.onError(function callback)Listens for the error event.
Parameters
- function callback: the callback function for the error event
callback parameter description:
| Property | Type | Default | Description |
|---|---|---|---|
| code | number | Error code | |
| errMsg | string | Error message |
error code description:
| Error code | Error message | Description |
|---|---|---|
| 1 | Bind error | |
| 2 | Error listening for packet messages | |
| 3 | connect call error | |
| 4 | Data send error | |
| 5 | Data receive error | |
| 6 | Set TTL error | |
| 7 | Domain name resolution failed |
