This commit is contained in:
azw 2023-08-19 15:43:55 +08:00
parent 66aa3a6fbb
commit 261a025565
2 changed files with 2 additions and 8 deletions

View File

@ -194,7 +194,7 @@ namespace a8
int prev_offset = 0;
do {
prev_offset = offset;
DecodeUserPacket(decoded_buff_, offset, decoded_bufflen_);
on_decode_userpacket(decoded_buff_, offset, decoded_bufflen_);
} while (prev_offset < offset && offset < decoded_bufflen_);
if (offset > 0 && offset < decoded_bufflen_){
@ -292,11 +292,6 @@ namespace a8
}
}
void WebSocketClient::DecodeUserPacket(char* buf, int& offset, unsigned int buflen)
{
int i = 0;
}
}
#endif

View File

@ -20,7 +20,7 @@ namespace a8
std::function<void (a8::WebSocketClient*, int)> on_error;
std::function<void (a8::WebSocketClient*)> on_connect;
std::function<void (a8::WebSocketClient*)> on_disconnect;
std::function<void (a8::WebSocketClient*, char*, unsigned int)> on_socketread;
std::function<void (char*, int&, unsigned int)> on_decode_userpacket;
void Open();
void Close();
@ -30,7 +30,6 @@ namespace a8
private:
void DecodePacket(char* buf, int& offset, unsigned int buflen);
void DecodeUserPacket(char* buf, int& offset, unsigned int buflen);
void ProcessHandShake(char* buf, int& offset, unsigned int buflen);
void ProcessWsHandShake(char* buf, int& offset, unsigned int buflen);