Merge pull request #18 from jhalitaksoy/fix/rtmt-connection-lost

decrease RTMT_WS_PING_INTERVAL
This commit is contained in:
Halit Aksoy 2022-09-05 18:12:26 +03:00 committed by GitHub
commit 9641a17029
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

1
src/consts/config.ts Normal file
View File

@ -0,0 +1 @@
export const RTMT_WS_PING_INTERVAL = 1000;

View File

@ -4,8 +4,7 @@ import { Bytes, OnClientConnectionChange, OnMessage, RTMT } from "./rtmt"
import WebSocket from "ws"
import * as http from 'http';
import { channel_ping, channel_pong } from "../consts/channel_names";
const PING_INTERVAL = 15000;
import { RTMT_WS_PING_INTERVAL } from "../consts/config";
export class RTMTWS implements RTMT {
@ -115,7 +114,7 @@ export class RTMTWS implements RTMT {
ws.isAlive = false;
sendMessageInternal(ws, channel_ping, {});
});
}, PING_INTERVAL);
}, RTMT_WS_PING_INTERVAL);
}
stopPingInterval() {