Narrow ping write lock.
This commit is contained in:
parent
2dbe40dca5
commit
1853c71114
|
|
@ -156,10 +156,9 @@ namespace Microsoft.Net.WebSockets
|
||||||
private async void SendKeepAliveAsync()
|
private async void SendKeepAliveAsync()
|
||||||
{
|
{
|
||||||
// Check concurrent writes, pings & pongs, or closes
|
// Check concurrent writes, pings & pongs, or closes
|
||||||
bool lockAquired = await _writeLock.WaitAsync(TimeSpan.FromMinutes(1)); // TODO: Wait up to KeepAliveInterval?
|
if (!_writeLock.Wait(0))
|
||||||
if (!lockAquired)
|
|
||||||
{
|
{
|
||||||
// Pings aren't that important, discard them if we can't take the lock.
|
// Sending real data is better than a ping, discard it.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue