Exemple #1
0
        /// <summary>
        /// Opens a TCP/IP connection to the driver/feed server
        /// </summary>
        /// <param name="myGW"></param>
        /// <param name="myName">feed name - return on message tag</param>
        /// <param name="myServer"></param>
        /// <param name="myPort"></param>
        public void openClientGW(out K2Gateway.TCPClientGateway myGW, string myName, string myServer, int myPort)
        {
            m_RTDForm.ConnectionStatus = "openClientGW";
            myGW = new K2Gateway.TCPClientGateway(myServer, myPort);
            myGW.Tag = myName;

            myGW.OnMessage += new K2Gateway.OnMessageEvent(OnRTDMessage);
            myGW.OnStatus += new K2Gateway.OnStatusEvent(OnChannelStatusMessage);
            myGW.Open();
        }
Exemple #2
0
        /// <summary>
        /// Open a RTD TCP channel
        /// </summary>
        /// <param name="myName">name of endpoint</param>
        /// <param name="myServer">server address</param>
        /// <param name="myPort">port </param>
        private void openGW(string myName, string myServer, int myPort)
        {
            try
            {

                K2Gateway.TCPClientGateway myGW;

                openClientGW(out myGW, myName, myServer, myPort);

                if (m_ClientGWs.ContainsKey(myName))
                {
                    m_ClientGWs[myName] = myGW;
                }
                else
                {
                    m_ClientGWs.Add(myName, myGW);

                }

                if (myName.ToUpper() == "DEFAULT")
                {
                    m_DefaultClientGW = myGW;
                }

            }
            catch (Exception myE)
            {
                //m_Log.Error("openChannel:" + myName, myE);
            }
        }