@@ -202,7 +202,6 @@ public async Task NoFile_Succeeds(bool usePreBuffer, bool usePostBuffer)
202
202
}
203
203
204
204
[ Fact ]
205
- [ ActiveIssue ( "https://github.com/dotnet/runtime/issues/47734" ) ]
206
205
public async Task SliceBuffers_Success ( )
207
206
{
208
207
if ( ! SupportsSendFileSlicing ) return ; // The overloads under test only support sending byte[] without offset and length
@@ -215,17 +214,25 @@ public async Task SliceBuffers_Success()
215
214
rnd . NextBytes ( postBuffer ) ;
216
215
217
216
byte [ ] expected = preBuffer . ToArray ( ) . Concat ( postBuffer . ToArray ( ) ) . ToArray ( ) ;
217
+ uint expectedChecksum = Fletcher32 . Checksum ( expected , 0 , expected . Length ) ;
218
218
219
219
( Socket client , Socket server ) = SocketTestExtensions . CreateConnectedSocketPair ( ) ;
220
220
221
221
using ( client )
222
222
using ( server )
223
223
{
224
224
await SendFileAsync ( client , null , preBuffer , postBuffer , TransmitFileOptions . UseDefaultWorkerThread ) ;
225
- byte [ ] receiveBuffer = new byte [ 100 ] ;
226
- int receivedBytes = server . Receive ( receiveBuffer ) ;
227
- Assert . Equal ( 100 , receivedBytes ) ;
228
- AssertExtensions . SequenceEqual ( expected , receiveBuffer ) ;
225
+ Fletcher32 receivedChecksum = new Fletcher32 ( ) ;
226
+ byte [ ] receiveBuffer = new byte [ expected . Length ] ;
227
+ int receivedBytes ;
228
+ int totalReceived = 0 ;
229
+ while ( totalReceived < expected . Length && ( receivedBytes = server . Receive ( receiveBuffer ) ) != 0 )
230
+ {
231
+ totalReceived += receivedBytes ;
232
+ receivedChecksum . Add ( receiveBuffer , 0 , receivedBytes ) ;
233
+ }
234
+ Assert . Equal ( expected . Length , totalReceived ) ;
235
+ Assert . Equal ( expectedChecksum , receivedChecksum . Sum ) ;
229
236
}
230
237
}
231
238
0 commit comments