You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our case, the server is sending keepAliveTimeout == 6.
So, after calculating the _checkInterval, the result is 0 because the code uses numberWithInteger and also integerValue (instead of using doubles) while trying to pull the data into the Heartbeat Monitor's timer.
When _checkInterval is equals to 0, that means that the Heartbeat Monitor's timer is instantiated with timeInterval == 0, which causes the timer to run every 0.001 seconds and finally a serious CPU overload.
The code for instantiating the timer is in file SRHeartbeatMonitor.m line 50:
In the file
SRKeepAliveData.m
there's a calculation in order to determine what is the_checkInterval
._checkInterval = [NSNumber numberWithInteger:(([_timeout integerValue] - [_timeoutWarning integerValue]) / 3)];
In our case, the server is sending keepAliveTimeout == 6.
So, after calculating the
_checkInterval
, the result is 0 because the code usesnumberWithInteger
and alsointegerValue
(instead of using doubles) while trying to pull the data into the Heartbeat Monitor's timer.When
_checkInterval
is equals to 0, that means that the Heartbeat Monitor's timer is instantiated withtimeInterval
== 0, which causes the timer to run every 0.001 seconds and finally a serious CPU overload.The code for instantiating the timer is in file
SRHeartbeatMonitor.m
line 50:_timer = [NSTimer scheduledTimerWithTimeInterval:[[[_connection keepAliveData] checkInterval] integerValue] target:self selector:@selector(heartbeat:) userInfo:nil repeats:YES];
Thank you very much,
Liron.Y
The text was updated successfully, but these errors were encountered: