:- use_module(library(http/websocket)). [det]ws_close(+WebSocket:stream_pair, 
+Code, +Data)
[det]ws_close(+WebSocket:stream_pair, 
+Code, +Data)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. | 
websocket_error(unexpected_message, Reply) if the other 
side did not send a close message in reply.