@@ -49,16 +49,13 @@ export class Framer {
49
49
private outputFramesByteLength = 0 ;
50
50
public outputBackup = new Map < number , Frame [ ] > ( ) ;
51
51
public _tickCount = 0 ;
52
- private lastPingSent = 0 ;
53
- private lastPongReceived = 0 ;
54
52
55
53
constructor ( client : Client ) {
56
54
this . client = client ;
57
55
this . outputFrameQueue = new Frameset ( ) ;
58
56
this . outputFrameQueue . frames = [ ] ;
59
57
this . outputOrderIndex = Array . from < number > ( { length : 32 } ) . fill ( 0 ) ;
60
58
this . outputSequenceIndex = Array . from < number > ( { length : 32 } ) . fill ( 0 ) ;
61
- this . lastPongReceived = Date . now ( ) ;
62
59
}
63
60
64
61
public tick ( ) {
@@ -73,27 +70,11 @@ export class Framer {
73
70
return ;
74
71
}
75
72
76
- const now = Date . now ( ) ;
77
-
78
- if (
79
- now - this . lastPongReceived > 30000 &&
80
- this . client . status === Status . Connected
81
- ) {
82
- Logger . warn (
83
- "[Framer] No pong received in last 30 seconds, disconnecting" ,
84
- ) ;
85
- this . client . cleanup ( ) ;
86
- return ;
87
- }
88
-
89
73
if ( this . _tickCount % 50 === 0 ) {
90
- this . lastPingSent = now ;
74
+ const now = Date . now ( ) ;
91
75
const ping = new ConnectedPing ( ) ;
92
76
ping . timestamp = BigInt ( now ) ;
93
77
this . frameAndSend ( ping . serialize ( ) , Priority . Immediate ) ;
94
- Logger . debug (
95
- `[Framer] Sent ping at ${ now } , last pong received: ${ this . lastPongReceived } ` ,
96
- ) ;
97
78
}
98
79
99
80
const ackSeqs = this . receivedFrameSequences ;
@@ -248,7 +229,6 @@ export class Framer {
248
229
}
249
230
case Packet . ConnectedPong : {
250
231
const packet = new ConnectedPong ( frame . payload ) . deserialize ( ) ;
251
- this . lastPongReceived = Date . now ( ) ;
252
232
Logger . debug (
253
233
`[Framer] Received pong, latency: ${
254
234
Date . now ( ) - Number ( packet . pingTime )
@@ -453,7 +433,6 @@ export class Framer {
453
433
priority : Priority = Priority . Normal ,
454
434
) : void {
455
435
const frame = new Frame ( ) ;
456
- frame . reliability = Reliability . ReliableOrdered ;
457
436
frame . orderChannel = 0 ;
458
437
frame . payload = payload ;
459
438
this . sendFrame ( frame , priority ) ;
0 commit comments