File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/libraries/System.Net.WebSockets.Client/tests Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 22// The .NET Foundation licenses this file to you under the MIT license.
33
44using System . Collections . Generic ;
5+ using System . IO ;
56using System . Net . Test . Common ;
67using System . Threading ;
78using System . Threading . Tasks ;
@@ -277,10 +278,18 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
277278 releaseServer . SetResult ( ) ;
278279 clientSocket . Dispose ( ) ;
279280 }
280- } , server => server . AcceptConnectionAsync ( async connection =>
281+ } , async server =>
281282 {
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 } ) ;
284293 }
285294 }
286295}
You can’t perform that action at this time.
0 commit comments