onConnectFailed
Feature Introduction
info
This callback is triggered when the establishment of a WebSocket connection fails.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- Unity
Return Prototype
Function()? onConnectFailed;
Return Prototype
- (void)onConnectFailed:(NSInteger)code err:(NSString *)err;
Function Prototype
void onConnectFailed(long code, String error);
Return Results
Name | Type | Description |
---|---|---|
code | long | Error code |
error | String | Error message |
Return Prototype
onConnectFailed(data: WSEvent): void;
Call Example
import { getSDK, CbEvents } from '@openim/wasm-client-sdk';
// or
// import { getSDK, CbEvents } from '@openim/client-sdk';
// const IMSDK = getSDK();
const IMSDK = getSDK();
IMSDK.on(CbEvents.OnConnectFailed, ({ errCode, errMsg }) => {});
Return Results
Name | Type | Description |
---|---|---|
data | WSEvent | Connection failure error information |
Return Prototype
onConnectFailed(data: WSEvent): void;
Return Results
Name | Type | Description |
---|---|---|
data | WSEvent | Connection failure error information |
Call Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.subscribe(IMSDK.IMEvents.OnConnectFailed, ({ errCode, errMsg }) => {});
Prototype
void OnConnectFailed(int errCode, string errMsg);