Example #1
0
        /// <summary>
        /// Constrguctor
        /// </summary>
        /// <param name="serverIPAddress"></param>
        /// <param name="port"></param>
        /// <param name="autoConnect"></param>
        public MinaTCPClient(IPAddress serverIPAddress, Int32 port, DProcessMessage callProcessMessage, bool autoConnect = true)
        {
            _logger   = LogManager.GetCurrentClassLogger();
            Connected = false;

            _serverIpAddress   = serverIPAddress;
            _port              = port;
            CallProcessMessage = callProcessMessage;

            Manager = new TCPClientProtocolManager();
        }
Example #2
0
        /// <summary>
        /// AutoReConnect
        /// </summary>
        private void AutoReConnect(object sender, ElapsedEventArgs e)
        {
            lock (_lockObject2)
            {
                if (Connected)
                {
                    return;
                }

                if (AutoConnections)
                {
                    _logger.Info(String.Format("AutoConnections ON try to connect to {0}:{1}", _serverIpAddress, _port));
                    Manager = new TCPClientProtocolManager();
                    OpenMinaSocket();
                }
            }
        }