Esempio n. 1
0
        public ISPSReceiver(TcpClient sock, Finesse finesseObj, ISPSClient ispsClient)
        {
            this.sock        = sock;
            this.writeStream = sock.GetStream();
            Encoding encode = System.Text.Encoding.GetEncoding("UTF-8");

            this.reader     = new StreamReader(writeStream, encode);
            this.logwrite   = LogWrite.getInstance();
            this.finesseObj = finesseObj;   // Finesse 로 부터 받은 콜 관련 데이터 이벤트 콜백 호출을 위한 객체
            this.ispsClient = ispsClient;
        }
Esempio n. 2
0
 public ISPSSender(LogWrite logwrite, ISPSClient ispsClient)
 {
     this.logwrite   = logwrite;
     this.ispsClient = ispsClient;
 }
Esempio n. 3
0
        public int fnConnect(String fn_A_IP, String fn_B_IP, String AEMS_A_IP, String AEMS_B_IP, int AEMS_Port, String ISPS_A_IP, String ISPS_B_IP, int ISPS_Port, int loglevel)
        {
            logwrite.write("", "");
            logwrite.write("fnConnect", "\t ** call fnConnect() **");

            StringBuilder sb = new StringBuilder();

            logwrite.write("fnConnect", "Finesse A \t [" + fn_A_IP + "]");
            logwrite.write("fnConnect", "Finesse B \t [" + fn_B_IP + "]");
            logwrite.write("fnConnect", "AEMS A \t [" + AEMS_A_IP + "]");
            logwrite.write("fnConnect", "AEMS B \t [" + AEMS_B_IP + "]");
            logwrite.write("fnConnect", "AEMS Port \t [" + AEMS_Port + "]");
            logwrite.write("fnConnect", "ISPS A \t [" + ISPS_A_IP + "]");
            logwrite.write("fnConnect", "ISPS B \t [" + ISPS_B_IP + "]");
            logwrite.write("fnConnect", "ISPS Port \t [" + ISPS_Port + "]");
            logwrite.write("fnConnect", "Loglevel \t [" + loglevel + "]");

            int finesseport = SERVERINFO.Finesse_PORT;

            // 각 서버정보 객체화
            finesseInfo = new ServerInfo(fn_A_IP, fn_B_IP, finesseport);
            aemsInfo    = new ServerInfo(AEMS_A_IP, AEMS_B_IP, AEMS_Port);
            ispsInfo    = new ServerInfo(ISPS_A_IP, ISPS_B_IP, ISPS_Port);

            /*
             *  finesse 세션 연결
             * */

            if (isFinesseConnected)
            {
                logwrite.write("fnConnect", "Finesse is Already Connected!!");
            }
            else
            {
                FinesseClient = new FinesseClient(logwrite, this);
                FinesseClient.setServerInfo(finesseInfo);
                if (FinesseClient.startClient() != ERRORCODE.SUCCESS)
                {
                    logwrite.write("fnConnect", "Finesse Cannot Connect");
                    isFinesseConnected = false;
                    logwrite.write("fnConnect", "\t Return Data : " + ERRORCODE.FAIL);
                    return(ERRORCODE.FAIL);
                }
                else
                {
                    isFinesseConnected = true;
                }
            }

            if (isAEMSConnected)
            {
                logwrite.write("fnConnect", "AEMS is Already Connected!!");
            }
            else
            {
                AEMSClient = new AEMSClient(logwrite, this);
                AEMSClient.setServerInfo(aemsInfo);

                isAEMSConnected = false;

                /*
                 * if (AEMSClient.aemsConnect() != ERRORCODE.SUCCESS)
                 * {
                 *  logwrite.write("fnConnect", "AEMS Cannot Connect");
                 *  isAEMSConnected = false;
                 *  return ERRORCODE.FAIL;
                 * }
                 * else
                 * {
                 *  isAEMSConnected = true;
                 *  AEMSClient.disconnect();
                 * }
                 * */
            }

            if (isISPSConnected)
            {
                logwrite.write("fnConnect", "ISPS is Already Connected!!");
            }
            else
            {
                ISPSClient = new ISPSClient(logwrite, this);
                ISPSClient.setServerInfo(ispsInfo);
                isISPSConnected = false;

                /*
                 * if (ISPSClient.ispsConnect() != ERRORCODE.SUCCESS)
                 * {
                 *  logwrite.write("fnConnect", "ISPS Cannot Connect");
                 *  isISPSConnected = false;
                 *  return ERRORCODE.FAIL;
                 * }
                 * else
                 * {
                 *  isISPSConnected = true;
                 *  ISPSClient.disconnect();
                 * }
                 * */
            }

            logwrite.write("fnConnect", "\t Return Data : " + ERRORCODE.SUCCESS);

            return(ERRORCODE.SUCCESS);
        }