Advertisement
bueddl

websocket server usage example 01

Feb 20th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <websocket>
  2.  
  3. class handler : public websocket::client_handler {
  4.  
  5.     void on_receive_ping(const websocket::packet &ping) override
  6.     {
  7.         client().send_pong(ping);
  8.     }
  9. };
  10.  
  11. int main()
  12. {
  13.     websocket::server<handler> ws;
  14.     ws.listen(7331);
  15.  
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement