@@ -90,7 +90,11 @@ websocket_info(Req, Message, State) ->
90
90
91
91
websocket_handle (Req , Message , State ) ->
92
92
io :fwrite (standard_error , " example_ws_handle: ~p~n " , [Message ]),
93
+ % % default behaviour.
93
94
{ok , State }.
95
+ % % comment the line above ({ok, State}.)
96
+ % % and uncomment the line below for an echo server.
97
+ % {reply, Message, State}.
94
98
95
99
96
100
% %
@@ -99,8 +103,8 @@ websocket_handle(Req, Message, State) ->
99
103
100
104
% % websocket_open and websocket_close events are sent when the websocket
101
105
% % opens, and when it closes.
102
- websocket_handle_event (websocket_open , [_Version , _Compress ], _ ) -> ok ;
103
- websocket_handle_event (websocket_close , [_Reason ], _ ) -> ok ;
106
+ websocket_handle_event (websocket_open , [_ , _Version , _Compress ], _ ) -> ok ;
107
+ websocket_handle_event (websocket_close , [_ , _Reason ], _ ) -> ok ;
104
108
105
109
% % websocket_throw, websocket_error and websocket_exit events are sent if
106
110
% % the user callback code throws an exception, has an error or
0 commit comments