Merge pull request #18 from jhalitaksoy/fix/rtmt-connection-lost
decrease RTMT_WS_PING_INTERVAL
This commit is contained in:
commit
9641a17029
1
src/consts/config.ts
Normal file
1
src/consts/config.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const RTMT_WS_PING_INTERVAL = 1000;
|
||||||
@ -4,8 +4,7 @@ import { Bytes, OnClientConnectionChange, OnMessage, RTMT } from "./rtmt"
|
|||||||
import WebSocket from "ws"
|
import WebSocket from "ws"
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
import { channel_ping, channel_pong } from "../consts/channel_names";
|
import { channel_ping, channel_pong } from "../consts/channel_names";
|
||||||
|
import { RTMT_WS_PING_INTERVAL } from "../consts/config";
|
||||||
const PING_INTERVAL = 15000;
|
|
||||||
|
|
||||||
export class RTMTWS implements RTMT {
|
export class RTMTWS implements RTMT {
|
||||||
|
|
||||||
@ -115,7 +114,7 @@ export class RTMTWS implements RTMT {
|
|||||||
ws.isAlive = false;
|
ws.isAlive = false;
|
||||||
sendMessageInternal(ws, channel_ping, {});
|
sendMessageInternal(ws, channel_ping, {});
|
||||||
});
|
});
|
||||||
}, PING_INTERVAL);
|
}, RTMT_WS_PING_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
stopPingInterval() {
|
stopPingInterval() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user