Ejemplo n.º 1
0
        /// <summary>
        /// Disconnects, without closing. Upon re-connection all existing subscriptions
        /// and publications will be restablished.
        /// </summary>
        public async Task Disconnect()
        {
            if (log.IsDebugEnabled)
            {
                log.Debug("Disconnecting from " + URL);
            }

            if (CONNECTED == Interlocked.CompareExchange(ref _isConnected, NOT_CONNECTED, CONNECTED))
            {
                await _ctrl.DisconnectAsync();

                _ctrl = null;
                OnDisconnect(new OnDisconnectEventArgs(URL));
                if (log.IsDebugEnabled)
                {
                    log.Debug("Disconnected from " + URL);
                }
            }
            else
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Unable to disconnect from " + URL);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Disconnects, without closing. Upon re-connection all existing subscriptions
        /// and publications will be restablished.
        /// </summary>
        public async Task Disconnect()
        {
            System.Diagnostics.Debug.WriteLine($"Disconnecting from {URL}");

            if (CONNECTED == Interlocked.CompareExchange(ref _isConnected, NOT_CONNECTED, CONNECTED))
            {
                await _ctrl.DisconnectAsync();

                _ctrl = null;
                OnDisconnect(new OnDisconnectEventArgs(URL));
                System.Diagnostics.Debug.WriteLine($"Disconnected from {URL}");
            }
            else
            {
                System.Diagnostics.Debug.WriteLine($"Unable to disconnect from {URL}");
            }
        }
Ejemplo n.º 3
0
 public void Disconnect()
 {
     ctrlLink.DisconnectAsync();
     OnDisconnect(this.url);
 }
Ejemplo n.º 4
0
 public void Disconnect()
 {
     ctrlLink.DisconnectAsync();
     OnDisconnect(this, new StringHandlerEventArgs(this.url));
 }