Skip to content

Commit

Permalink
remove CallbackClosure cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Kizer committed Apr 18, 2021
1 parent 3a1b865 commit 27305b2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private IAsyncResult BeginSendFileInternal(string? fileName, byte[]? preBuffer,
throw new SocketException((int)errorCode);
}

asyncResult.FinishPostingAsyncOp(ref Caches.SendClosureCache);
asyncResult.FinishPostingAsyncOp();

return asyncResult;
}
Expand Down
23 changes: 0 additions & 23 deletions src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ public partial class Socket : IDisposable
private SocketType _socketType;
private ProtocolType _protocolType;

// These caches are one degree off of Socket since they're not used in the sync case/when disabled in config.
private CacheSet? _caches;

private sealed class CacheSet
{
internal CallbackClosure? AcceptClosureCache;
internal CallbackClosure? SendClosureCache;
internal CallbackClosure? ReceiveClosureCache;
}

// Bool marked true if the native socket option IP_PKTINFO or IPV6_PKTINFO has been set.
private bool _receivingPacketInformation;

Expand Down Expand Up @@ -3008,19 +2998,6 @@ private bool SendToAsync(SocketAsyncEventArgs e, CancellationToken cancellationT
// Internal and private properties
//

private CacheSet Caches
{
get
{
if (_caches == null)
{
// It's not too bad if extra of these are created and lost.
_caches = new CacheSet();
}
return _caches;
}
}

internal bool Disposed => _disposed != 0;

//
Expand Down

0 comments on commit 27305b2

Please sign in to comment.