Пример #1
0
 /// <summary>
 ///     Constructor.
 /// </summary>
 protected ClientBase()
 {
     _pingTimer = new SimpleConnectionTimer(30000);
     _pingTimer.Elapsed += PingTimer_Elapsed;
     ConnectTimeout = DefaultConnectionAttemptTimeout;
     WireProtocol = WireProtocolManager.GetDefaultWireProtocol();
 }
Пример #2
0
 /// <summary>
 ///     Constructor.
 /// </summary>
 protected ClientBase()
 {
     _pingTimer          = new SimpleConnectionTimer(30000);
     _pingTimer.Elapsed += PingTimer_Elapsed;
     ConnectTimeout      = DefaultConnectionAttemptTimeout;
     WireProtocol        = WireProtocolManager.GetDefaultWireProtocol();
 }
Пример #3
0
        /// <summary>
        ///     Creates a new ClientReConnecter object.
        ///     It is not needed to start ClientReConnecter since it automatically
        ///     starts when the client disconnected.
        /// </summary>
        /// <param name="client">Reference to client object</param>
        /// <exception cref="ArgumentNullException">Throws ArgumentNullException if client is null.</exception>
        public ClientReConnecter(IConnectableClient client)
        {
            if (client == null) {
                throw new ArgumentNullException("client");
            }

            _client = client;
            _client.Disconnected += Client_Disconnected;
            _reconnectTimer = new SimpleConnectionTimer(20000);
            _reconnectTimer.Elapsed += ReconnectTimer_Elapsed;
            _reconnectTimer.Start();
        }
Пример #4
0
        /// <summary>
        ///     Creates a new ClientReConnecter object.
        ///     It is not needed to start ClientReConnecter since it automatically
        ///     starts when the client disconnected.
        /// </summary>
        /// <param name="client">Reference to client object</param>
        /// <exception cref="ArgumentNullException">Throws ArgumentNullException if client is null.</exception>
        public ClientReConnecter(IConnectableClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            _client = client;
            _client.Disconnected    += Client_Disconnected;
            _reconnectTimer          = new SimpleConnectionTimer(20000);
            _reconnectTimer.Elapsed += ReconnectTimer_Elapsed;
            _reconnectTimer.Start();
        }