File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -246,5 +246,33 @@ public virtual async Task Client_shouldnt_time_out_when_Disconnect_is_called_mor
246246 await Task . Delay ( TimeSpan . FromSeconds ( 1 ) ) ; // client gets close_session and disconnects
247247 await Task . Run ( client . Dispose ) . Timeout ( 2 ) ; // client calls Dispose and disconnects
248248 }
249+
250+ [ Fact ]
251+ public virtual async Task Client_shouldnt_time_out_when_dispose_is_called_after_remote_disconnect ( )
252+ {
253+ _serverFixture . TestService . TestMethodFake = _ =>
254+ {
255+ RemotingSession . Current . Close ( ) ;
256+ return null ;
257+ } ;
258+
259+ using var client = new RemotingClient ( new ClientConfig
260+ {
261+ ConnectionTimeout = 0 ,
262+ InvocationTimeout = 0 ,
263+ SendTimeout = 0 ,
264+ MessageEncryption = false ,
265+ ServerPort = _serverFixture . Server . Config . NetworkPort ,
266+ Channel = ClientChannel ,
267+ WaitTimeForGoodbyeOnDisconnect = 100 //We will set such a timeout so that the client is guaranteed not to wait more than 3 seconds.
268+ } ) ;
269+
270+ client . Connect ( ) ;
271+
272+ var proxy = client . CreateProxy < ITestService > ( ) ;
273+
274+ proxy . TestMethod ( null ) ; // server sends close_session
275+ await Task . Run ( client . Dispose ) . Timeout ( 3 ) ; // client calls Dispose and disconnects
276+ }
249277}
250278
You can’t perform that action at this time.
0 commit comments