@@ -168,8 +168,12 @@ public static void WebSocket_Http_Duplex_Buffered(NetHttpMessageEncoding message
168
168
"The logging done by the Server was not returned via the Callback." ) ;
169
169
170
170
// *** CLEANUP *** \\
171
- ( ( ICommunicationObject ) client ) . Close ( ) ;
172
- channelFactory . Close ( ) ;
171
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
172
+ if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
173
+ {
174
+ ( ( ICommunicationObject ) client ) . Close ( ) ;
175
+ channelFactory . Close ( ) ;
176
+ }
173
177
}
174
178
finally
175
179
{
@@ -236,8 +240,12 @@ public static void WebSocket_Http_Duplex_Buffered_KeepAlive(NetHttpMessageEncodi
236
240
"The logging done by the Server was not returned via the Callback." ) ;
237
241
238
242
// *** CLEANUP *** \\
239
- ( ( ICommunicationObject ) client ) . Close ( ) ;
240
- channelFactory . Close ( ) ;
243
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
244
+ if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
245
+ {
246
+ ( ( ICommunicationObject ) client ) . Close ( ) ;
247
+ channelFactory . Close ( ) ;
248
+ }
241
249
}
242
250
finally
243
251
{
@@ -471,7 +479,7 @@ public static void WebSocket_Http_RequestReply_Streamed(NetHttpMessageEncoding m
471
479
}
472
480
473
481
// *** CLEANUP *** \\
474
- // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method.
482
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux) .
475
483
if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
476
484
{
477
485
( ( ICommunicationObject ) client ) . Close ( ) ;
@@ -529,9 +537,13 @@ public static void WebSocket_Http_RequestReply_Buffered(NetHttpMessageEncoding m
529
537
}
530
538
531
539
// *** CLEANUP *** \\
540
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
541
+ if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
542
+ {
532
543
( ( ICommunicationObject ) client ) . Close ( ) ;
533
544
channelFactory . Close ( ) ;
534
545
}
546
+ }
535
547
finally
536
548
{
537
549
// *** ENSURE CLEANUP *** \\
@@ -583,7 +595,7 @@ public static void WebSocket_Http_RequestReply_Buffered_KeepAlive(NetHttpMessage
583
595
}
584
596
585
597
// *** CLEANUP *** \\
586
- // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method.
598
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux) .
587
599
if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
588
600
{
589
601
( ( ICommunicationObject ) client ) . Close ( ) ;
@@ -642,8 +654,12 @@ public static void WebSocket_Https_RequestReply_Buffered(NetHttpMessageEncoding
642
654
}
643
655
644
656
// *** CLEANUP *** \\
645
- ( ( ICommunicationObject ) client ) . Close ( ) ;
646
- channelFactory . Close ( ) ;
657
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
658
+ if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
659
+ {
660
+ ( ( ICommunicationObject ) client ) . Close ( ) ;
661
+ channelFactory . Close ( ) ;
662
+ }
647
663
}
648
664
finally
649
665
{
@@ -699,8 +715,12 @@ public static void WebSocket_Https_RequestReply_Buffered_KeepAlive(NetHttpMessag
699
715
}
700
716
701
717
// *** CLEANUP *** \\
702
- ( ( ICommunicationObject ) client ) . Close ( ) ;
703
- channelFactory . Close ( ) ;
718
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
719
+ if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
720
+ {
721
+ ( ( ICommunicationObject ) client ) . Close ( ) ;
722
+ channelFactory . Close ( ) ;
723
+ }
704
724
}
705
725
finally
706
726
{
@@ -865,8 +885,12 @@ public static void WebSocket_Http_VerifyWebSocketsUsed()
865
885
Assert . True ( responseFromService , String . Format ( "Response from the service was not expected. Expected: 'True' but got {0}" , responseFromService ) ) ;
866
886
867
887
// *** CLEANUP *** \\
868
- ( ( ICommunicationObject ) client ) . Close ( ) ;
869
- channelFactory . Close ( ) ;
888
+ // Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
889
+ if ( ! ScenarioTestHelpers . IsLocalHost ( ) )
890
+ {
891
+ ( ( ICommunicationObject ) client ) . Close ( ) ;
892
+ channelFactory . Close ( ) ;
893
+ }
870
894
}
871
895
finally
872
896
{
0 commit comments