/// <summary> /// Disposes the specified disposing. /// </summary> /// <param name="disposing">if set to <c>true</c> [disposing].</param> private void Dispose(bool disposing) { if (!this.isDisposed) { if (disposing) { // Release managed resources here this.CloseAsync().GetAwaiter().GetResult(); } // Call the appropriate methods to clean up // unmanaged resources here. // If disposing is false, // only the following code is executed. this.connectionString = null; this.userAddress = null; this.saslMechanism = null; this.people = null; this.activity = null; this.capabilities = null; this.personalEventing = null; this.presence = null; this.serverCapabilities = null; this.serverFeatures = ServerFeatures.None; this.state = XmppTransportState.Closed; this.CloseTransport(); this.DisposeSubscriptions(); this.ReleaseSubjects(); } this.isDisposed = true; }
/// <summary> /// Initializes a new instance of the <see cref="XmppTransport"/> class. /// </summary> internal XmppTransport() { this.state = XmppTransportState.Closed; this.stateChanged = new Subject <XmppTransportState>(); this.authenticationFailed = new Subject <SaslAuthenticationFailure>(); this.infoQueryStream = new Subject <InfoQuery>(); this.messageStream = new Subject <Message>(); this.presenceStream = new Subject <Presence>(); }