FIX: the server now closes the socket after 30s of no pong
This commit is contained in:
parent
a14e227706
commit
85f2dabe6c
3 changed files with 16 additions and 2 deletions
|
@ -20,7 +20,7 @@ import {parse} from "query-string";
|
|||
import {jwtTokenManager} from "../Services/JWTTokenManager";
|
||||
import {adminApi, CharacterTexture, FetchMemberDataByUuidResponse} from "../Services/AdminApi";
|
||||
import {SocketManager, socketManager} from "../Services/SocketManager";
|
||||
import {emitInBatch, resetPing} from "../Services/IoSocketHelpers";
|
||||
import {emitInBatch, pongMaxInterval, refresLogoutTimerOnPong, resetPing} from "../Services/IoSocketHelpers";
|
||||
import {clientEventsEmitter} from "../Services/ClientEventsEmitter";
|
||||
import {ADMIN_API_TOKEN, ADMIN_API_URL} from "../Enum/EnvironmentVariable";
|
||||
|
||||
|
@ -240,6 +240,7 @@ export class IoSocketController {
|
|||
const client = this.initClient(ws); //todo: into the upgrade instead?
|
||||
socketManager.handleJoinRoom(client);
|
||||
resetPing(client);
|
||||
refresLogoutTimerOnPong(ws as ExSocketInterface);
|
||||
|
||||
//get data information and show messages
|
||||
if (ADMIN_API_URL) {
|
||||
|
@ -292,6 +293,9 @@ export class IoSocketController {
|
|||
drain: (ws) => {
|
||||
console.log('WebSocket backpressure: ' + ws.getBufferedAmount());
|
||||
},
|
||||
pong(ws) {
|
||||
refresLogoutTimerOnPong(ws as ExSocketInterface);
|
||||
},
|
||||
close: (ws, code, message) => {
|
||||
const Client = (ws as ExSocketInterface);
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue