From f985ad1a4c11a8676ccd14d87fd11cd2c6dd75a6 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 18 May 2019 19:44:03 +0200 Subject: Closing a websocket may send a reason --- websocksy.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'websocksy.h') diff --git a/websocksy.h b/websocksy.h index dd34959..2073287 100644 --- a/websocksy.h +++ b/websocksy.h @@ -8,7 +8,8 @@ typedef enum { ws_new = 0, ws_http, - ws_open + ws_open, + ws_closed } ws_state; //RFC Section 5.2 @@ -21,6 +22,19 @@ typedef enum { ws_frame_pong = 10 } ws_operation; +//RFC Section 7.4.1 +typedef enum { + ws_close_http = 100, + ws_close_normal = 1000, + ws_close_shutdown = 1001, + ws_close_proto = 1002, + ws_close_data = 1003, + ws_close_format = 1007, + ws_close_policy = 1008, + ws_close_limit = 1009, + ws_close_unexpected = 1011 +} ws_close_reason; + struct { char* host; char* port; -- cgit v1.2.3