This repository was archived by the owner on Dec 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
src/Kestrel.Transport.Sockets/Internal Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ public async Task StartAsync(IConnectionDispatcher connectionDispatcher)
8686
8787 // Dispose the socket(should noop if already called)
8888 _socket . Dispose ( ) ;
89+ _receiver . Dispose ( ) ;
90+ _sender . Dispose ( ) ;
8991 }
9092 catch ( Exception ex )
9193 {
Original file line number Diff line number Diff line change 77
88namespace Microsoft . AspNetCore . Server . Kestrel . Transport . Sockets . Internal
99{
10- public class SocketReceiver
10+ public class SocketReceiver : IDisposable
1111 {
1212 private readonly Socket _socket ;
1313 private readonly SocketAsyncEventArgs _eventArgs = new SocketAsyncEventArgs ( ) ;
@@ -37,5 +37,10 @@ public SocketAwaitable ReceiveAsync(Memory<byte> buffer)
3737
3838 return _awaitable ;
3939 }
40+
41+ public void Dispose ( )
42+ {
43+ _eventArgs . Dispose ( ) ;
44+ }
4045 }
4146}
Original file line number Diff line number Diff line change 1111
1212namespace Microsoft . AspNetCore . Server . Kestrel . Transport . Sockets . Internal
1313{
14- public class SocketSender
14+ public class SocketSender : IDisposable
1515 {
1616 private readonly Socket _socket ;
1717 private readonly SocketAsyncEventArgs _eventArgs = new SocketAsyncEventArgs ( ) ;
@@ -98,5 +98,10 @@ private List<ArraySegment<byte>> GetBufferList(ReadOnlySequence<byte> buffer)
9898
9999 return _bufferList ;
100100 }
101+
102+ public void Dispose ( )
103+ {
104+ _eventArgs . Dispose ( ) ;
105+ }
101106 }
102107}
You can’t perform that action at this time.
0 commit comments