TCP插件API文档(Uniapp)
    正在准备搜索索引...

    类型别名 UtsTcpServerCallback

    TCP服务器运行回调函数。

    type UtsTcpServerCallback = {
        onConnected?: (session: UtsClientSession) => void;
        onReceivedData?: (
            session: UtsClientSession,
            message: UtsClientMessage,
        ) => void;
        onDisconnected?: (session: UtsClientSession) => void;
        onErrorStr?: (errorMsg: UtsErrorMessage) => void;
    }
    索引

    属性

    onConnected?: (session: UtsClientSession) => void

    客户端建立连接回调

    类型声明

    onReceivedData?: (session: UtsClientSession, message: UtsClientMessage) => void

    客户端发送过来的数据消息回调

    类型声明

    onDisconnected?: (session: UtsClientSession) => void

    客户端断开链接回调

    类型声明

    onErrorStr?: (errorMsg: UtsErrorMessage) => void

    错误消息回调

    类型声明