File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,10 @@ public function run($maxSeconds = null)
189
189
} else {
190
190
if (($ frame = $ this ->reader ->consumeFrame ($ this ->readBuffer )) === null ) {
191
191
$ now = microtime (true );
192
- $ nextStreamSelectTimeout = $ nextHeartbeat = ($ this ->lastWrite ?: $ now ) + $ this ->options ["heartbeat " ];
192
+ $ nextStreamSelectTimeout = ($ this ->lastWrite ?: $ now ) + $ this ->options ["heartbeat " ];
193
+ if (!isset ($ nextHeartbeat )) {
194
+ $ nextHeartbeat = $ now + $ this ->options ["heartbeat " ];
195
+ }
193
196
if ($ stopTime !== null && $ stopTime < $ nextStreamSelectTimeout ) {
194
197
$ nextStreamSelectTimeout = $ stopTime ;
195
198
}
@@ -224,6 +227,7 @@ public function run($maxSeconds = null)
224
227
$ now = microtime (true );
225
228
226
229
if ($ now >= $ nextHeartbeat ) {
230
+ $ nextHeartbeat = $ now + $ this ->options ["heartbeat " ];
227
231
$ this ->writer ->appendFrame (new HeartbeatFrame (), $ this ->writeBuffer );
228
232
$ this ->flushWriteBuffer ();
229
233
You can’t perform that action at this time.
0 commit comments