File tree Expand file tree Collapse file tree
tests/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,11 +102,14 @@ private async Task SendAsync(CancellationToken stopToken)
102102 if ( buffer . IsEmpty && read . IsCompleted )
103103 break ;
104104
105+ // ignore cancellation request until the read content is written to the sentDataBuffer
106+ var cancellationTokenForWritingSentData = CancellationToken . None ;
107+
105108 foreach ( var segment in buffer ) {
106- await sentDataBuffer . WriteAsync ( segment , stopToken ) . ConfigureAwait ( false ) ;
109+ await sentDataBuffer . WriteAsync ( segment , cancellationTokenForWritingSentData ) . ConfigureAwait ( false ) ;
107110 }
108111
109- await sentDataBuffer . FlushAsync ( stopToken ) . ConfigureAwait ( false ) ;
112+ await sentDataBuffer . FlushAsync ( cancellationTokenForWritingSentData ) . ConfigureAwait ( false ) ;
110113
111114 sendPipe . Reader . AdvanceTo ( buffer . End ) ;
112115 }
You can’t perform that action at this time.
0 commit comments