5 library(http/websocket): WebSocket support
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog HTTP support
        • library(http/websocket): WebSocket support
          • http_open_websocket/3
          • http_upgrade_to_websocket/3
          • ws_send/2
          • ws_receive/2
          • ws_receive/3
          • ws_close/3
          • ws_open/3
          • ws_property/2
          • ws_mask/1
Availability::- use_module(library(http/websocket)).
Source[det]ws_close(+WebSocket:stream_pair, +Code, +Data)
Close a WebSocket connection by sending a close message if this was not already sent and wait for the close reply.
Code is the numerical code indicating the close status. This is 16-bit integer. The codes are defined in section 7.4.1. Defined Status Codes of RFC6455. Notably, 1000 indicates a normal closure.
Data is currently interpreted as text.
Errors
websocket_error(unexpected_message, Reply) if the other side did not send a close message in reply.