/usr/local/lib/swipl/library/ext/http/http/websocket.pl
All Application Manual Name SummaryHelp

  • http
    • http
      • http_unix_daemon.pl
      • thread_httpd.pl -- Threaded HTTP server
      • http_wrapper.pl -- Server processing of an HTTP request
      • http_header.pl
      • http_stream.pl
      • http_exception.pl
      • http_path.pl
      • http_dispatch.pl
      • http_host.pl -- Obtain public server location
      • http_json.pl -- HTTP JSON Plugin module
      • http_client.pl -- HTTP client library
      • json.pl -- Reading and writing JSON serialization
      • http_open.pl -- HTTP client library
      • http_parameters.pl -- Extract parameters (GET and POST) from HTTP requests
      • http_multipart_plugin.pl -- Multipart form-data plugin
      • http_hook.pl -- HTTP library hooks
      • html_write.pl -- Write HTML text
      • html_quasiquotations.pl -- HTML quasi quotations
      • js_write.pl -- Utilities for including JavaScript
      • js_grammar.pl -- JavaScript grammar
      • http_server_files.pl -- Serve files needed by modules from the server
      • hub.pl -- Manage a hub for websockets
      • websocket.pl -- 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
      • http_session.pl -- HTTP Session management
      • http_cors.pl -- Enable CORS: Cross-Origin Resource Sharing
      • mimetype.pl -- Determine mime-type for a file
      • html_head.pl -- Automatic inclusion of CSS and scripts links
      • term_html.pl -- Represent Prolog terms as HTML
      • http_dyn_workers.pl -- Dynamically schedule HTTP workers.
      • http_log.pl -- HTTP Logging module
 ws_close(+WebSocket:stream_pair, +Code, +Data) is det
Close a WebSocket connection by sending a close message if this was not already sent and wait for the close reply.
Arguments:
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.