Commit 63b255f 1 parent 4cfc831 commit 63b255f Copy full SHA for 63b255f
File tree 1 file changed +12
-3
lines changed
src/libraries/System.Net.WebSockets.Client/tests
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
4
using System . Collections . Generic ;
5
+ using System . IO ;
5
6
using System . Net . Test . Common ;
6
7
using System . Threading ;
7
8
using System . Threading . Tasks ;
@@ -277,10 +278,18 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
277
278
releaseServer . SetResult ( ) ;
278
279
clientSocket . Dispose ( ) ;
279
280
}
280
- } , server => server . AcceptConnectionAsync ( async connection =>
281
+ } , async server =>
281
282
{
282
- await releaseServer . Task ;
283
- } ) , new LoopbackServer . Options { WebSocketEndpoint = true } ) ;
283
+ try
284
+ {
285
+ await server . AcceptConnectionAsync ( async connection =>
286
+ {
287
+ await releaseServer . Task ;
288
+ } ) ;
289
+ }
290
+ // Ignore IO exception on server as there are race conditions when client is cancelling.
291
+ catch ( IOException ) { }
292
+ } , new LoopbackServer . Options { WebSocketEndpoint = true } ) ;
284
293
}
285
294
}
286
295
}
You can’t perform that action at this time.
0 commit comments