Host Base. On Close(TimeSpan) Method
Closes down the hosted service, including their channel dispatchers and associated instance contexts and listeners.
protected: override void OnClose(TimeSpan timeout);
protected override void OnClose (TimeSpan timeout);
override this.OnClose : TimeSpan -> unit
Protected Overrides Sub OnClose (timeout As TimeSpan)
The TimeSpan that specifies how long the on-close operation has to complete before timing out.
Calling OnClose(TimeSpan) does the following:
Waits for all InstanceContext objects to close down, which happens when their associated channels finish sending all pending messages.
Closes the ChannelDispatcher objects associated with the host.