Add KeepAliveMode and SupportedWebSocketSubProtocols options#1154
Add KeepAliveMode and SupportedWebSocketSubProtocols options#1154
Conversation
| _lastPongReceivedUtc = DateTime.UtcNow; | ||
| } | ||
| } | ||
| catch { } // ignore deserialization errors in case the pong message does not match the expected format |
Check notice
Code scanning / CodeQL
Poor error handling: empty catch block
| _lastPongReceivedUtc = DateTime.UtcNow; | ||
| } | ||
| } | ||
| catch { } // ignore deserialization errors in case the pong message does not match the expected format |
Check notice
Code scanning / CodeQL
Generic catch clause
617576b to
2cad736
Compare
| if (smartKeepAlive) | ||
| return OnConnectionInitAsync(message); | ||
| else | ||
| return base.OnConnectionInitAsync(message, smartKeepAlive); |
Check notice
Code scanning / CodeQL
Missed ternary opportunity
| if (!smartKeepAlive) | ||
| return OnConnectionInitAsync(message); | ||
| else | ||
| return base.OnConnectionInitAsync(message, smartKeepAlive); |
Check notice
Code scanning / CodeQL
Missed ternary opportunity
| [Obsolete($"Please use the {nameof(OnConnectionInitAsync)} and {nameof(OnKeepAliveLoopAsync)} methods instead. This method will be removed in a future version of this library.")] | ||
| protected override Task OnConnectionInitAsync(OperationMessage message, bool smartKeepAlive) |
There was a problem hiding this comment.
The code has been carefully crafted to be fully backwards compatible, just in case of the rare instance that someone derived from this class to customize behavior.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1154 +/- ##
==========================================
- Coverage 90.88% 89.06% -1.82%
==========================================
Files 50 51 +1
Lines 2425 2543 +118
Branches 432 450 +18
==========================================
+ Hits 2204 2265 +61
- Misses 175 224 +49
- Partials 46 54 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds a 'secure' keep-alive mode where:
Reason:
Consider: