Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 1.02 KB

File metadata and controls

26 lines (21 loc) · 1.02 KB

WebSocketClient.Close

Close(reason)

Closes the WebSocket connection.

status
The status code to send with the close frame. This member is of type WINHTTP_WEB_SOCKET_CLOSE_STATUS and can be one of the following:

  • WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_ENDPOINT_TERMINATED_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_PROTOCOL_ERROR_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_INVALID_DATA_TYPE_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_EMPTY_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_ABORTED_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_INVALID_PAYLOAD_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_POLICY_VIOLATION_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_MESSAGE_TOO_BIG_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_UNSUPPORTED_EXTENSIONS_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_SERVER_ERROR_CLOSE_STATUS
  • WINHTTP_WEB_SOCKET_SECURE_HANDSHAKE_ERROR_CLOSE_STATUS

reason
The reason for closing the connection. This parameter is optional.

Return Value
NO_ERROR on success, otherwise an error code.