|
@@ -112,7 +112,7 @@ bool HttpHandler::SwitchWebSocket(hio_t* io) {
|
|
|
ws_channel->opcode = (enum ws_opcode)opcode;
|
|
ws_channel->opcode = (enum ws_opcode)opcode;
|
|
|
switch(opcode) {
|
|
switch(opcode) {
|
|
|
case WS_OPCODE_CLOSE:
|
|
case WS_OPCODE_CLOSE:
|
|
|
- ws_channel->close(true);
|
|
|
|
|
|
|
+ ws_channel->close();
|
|
|
break;
|
|
break;
|
|
|
case WS_OPCODE_PING:
|
|
case WS_OPCODE_PING:
|
|
|
// printf("recv ping\n");
|
|
// printf("recv ping\n");
|
|
@@ -141,7 +141,7 @@ bool HttpHandler::SwitchWebSocket(hio_t* io) {
|
|
|
ws_channel->setHeartbeat(ping_interval, [this](){
|
|
ws_channel->setHeartbeat(ping_interval, [this](){
|
|
|
if (last_recv_pong_time < last_send_ping_time) {
|
|
if (last_recv_pong_time < last_send_ping_time) {
|
|
|
hlogw("[%s:%d] websocket no pong!", ip, port);
|
|
hlogw("[%s:%d] websocket no pong!", ip, port);
|
|
|
- ws_channel->close(true);
|
|
|
|
|
|
|
+ ws_channel->close();
|
|
|
} else {
|
|
} else {
|
|
|
// printf("send ping\n");
|
|
// printf("send ping\n");
|
|
|
ws_channel->sendPing();
|
|
ws_channel->sendPing();
|