# SocketTask.close(Object object)

with Promise style call: Not supported

Mini Program plugin: Support

Stop WebSocket Connect

# parameter

# Object object

attribute type Default values Required Introductions
code number 1000 (indicates normal shutdown connection) no A numeric value represents the status number for which the connection was closed and indicates why the connection is closed.
reason string no A human-readable string representing the reason the connection was closed. This string must be no longer than 123 Byte UTF-8 Text (not characters).
success function no Interface calls the successful callback function
fail function no Interface calls failed callback functions
complete function no Callback function at the end of an interface call (both successful and unsuccessful calls are executed)