# Function: closeSocket

closeSocket(params?: CloseSocketParams): Promise‹CloseSocketRes

关闭 WebSocket 连接

# 参数:

属性 类型
params? CloseSocketParams

CloseSocketParams

属性 类型 描述
code? number 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。
reason? string 一个可读的字符串,表示连接被关闭的原因。 这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。
complete? Method 接口调用结束的回调函数(调用成功、失败都会执行)
fail? Method 接口调用失败的回调函数
success? Method 接口调用成功的回调函数

# 返回值:

Promise‹CloseSocketRes