@@ -83,34 +83,22 @@ namespace SL {
8383 class WSListener {
8484 std::shared_ptr<WSListenerImpl> Impl_;
8585 public:
86- // when a connection is fully established. If onconnect is called, then a matching onDisconnection is guaranteed
87- void onConnection (std::function<void (WSocket&, const std::unordered_map<std::string, std::string>&)>& handle);
8886 // when a connection is fully established. If onconnect is called, then a matching onDisconnection is guaranteed
8987 void onConnection (const std::function<void (WSocket&, const std::unordered_map<std::string, std::string>&)>& handle);
9088 // when a message has been received
91- void onMessage (std::function<void (WSocket&, const WSMessage&)>& handle);
92- // when a message has been received
9389 void onMessage (const std::function<void (WSocket&, const WSMessage&)>& handle);
9490 // when a socket is closed down for ANY reason. If onconnect is called, then a matching onDisconnection is guaranteed
95- void onDisconnection (std::function<void (WSocket&, unsigned short , const std::string&)>& handle);
96- // when a socket is closed down for ANY reason. If onconnect is called, then a matching onDisconnection is guaranteed
9791 void onDisconnection (const std::function<void (WSocket&, unsigned short , const std::string&)>& handle);
9892 // when a ping is received from a client
99- void onPing (std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
100- // when a ping is received from a client
10193 void onPing (const std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
10294 // when a pong is received from a client
103- void onPong (std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
104- // when a pong is received from a client
10595 void onPong (const std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
10696 // before onconnection is called, the conection is upgraded
107- void onHttpUpgrade (std::function<void (WSocket&)>& handle);
108- // before onconnection is called, the conection is upgraded
10997 void onHttpUpgrade (const std::function<void (WSocket&)>& handle);
11098 // the maximum payload size
11199 void set_MaxPayload (size_t bytes);
112100 // the maximum payload size
113- unsigned long long int get_MaxPayload ();
101+ size_t get_MaxPayload ();
114102 // maximum time in seconds before a client is considered disconnected -- for reads
115103 void set_ReadTimeout (std::chrono::seconds seconds);
116104 // get the current read timeout in seconds
@@ -131,34 +119,22 @@ namespace SL {
131119 class WSClient {
132120 std::shared_ptr<WSClientImpl> Impl_;
133121 public:
134- // when a connection is fully established. If onconnect is called, then a matching onDisconnection is guaranteed
135- void onConnection (std::function<void (WSocket&, const std::unordered_map<std::string, std::string>&)>& handle);
136122 // when a connection is fully established. If onconnect is called, then a matching onDisconnection is guaranteed
137123 void onConnection (const std::function<void (WSocket&, const std::unordered_map<std::string, std::string>&)>& handle);
138124 // when a message has been received
139- void onMessage (std::function<void (WSocket&, const WSMessage&)>& handle);
140- // when a message has been received
141125 void onMessage (const std::function<void (WSocket&, const WSMessage&)>& handle);
142126 // when a socket is closed down for ANY reason. If onconnect is called, then a matching onDisconnection is guaranteed
143- void onDisconnection (std::function<void (WSocket&, unsigned short , const std::string&)>& handle);
144- // when a socket is closed down for ANY reason. If onconnect is called, then a matching onDisconnection is guaranteed
145127 void onDisconnection (const std::function<void (WSocket&, unsigned short , const std::string&)>& handle);
146128 // when a ping is received from a client
147- void onPing (std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
148- // when a ping is received from a client
149129 void onPing (const std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
150130 // when a pong is received from a client
151- void onPong (std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
152- // when a pong is received from a client
153131 void onPong (const std::function<void (WSocket&, const unsigned char *, size_t )>& handle);
154132 // before onconnection is called, the conection is upgraded
155- void onHttpUpgrade (std::function<void (WSocket&)>& handle);
156- // before onconnection is called, the conection is upgraded
157133 void onHttpUpgrade (const std::function<void (WSocket&)>& handle);
158134 // the maximum payload size
159135 void set_MaxPayload (size_t bytes);
160136 // the maximum payload size
161- unsigned long long int get_MaxPayload ();
137+ size_t get_MaxPayload ();
162138 // maximum time in seconds before a client is considered disconnected -- for reads
163139 void set_ReadTimeout (std::chrono::seconds seconds);
164140 // get the current read timeout in seconds
0 commit comments