websocket : update handle_terminate() and client.deinit() codes

This commit is contained in:
liyingxin
2023-04-13 13:13:57 +08:00
parent 7f4a58546d
commit 2a1f026cda
3 changed files with 111 additions and 22 deletions
+6 -1
View File
@@ -44,6 +44,11 @@ void process(WFWebSocketTask *task)
}
}
void closed()
{
fprintf(stderr, "connection is close by system\n");
}
int main(int argc, char *argv[])
{
if (argc != 2)
@@ -54,7 +59,7 @@ int main(int argc, char *argv[])
return 0;
}
WebSocketClient client(process);
WebSocketClient client(process, closed);
client.init(argv[1]);
WFFacilities::WaitGroup wg(1);