示例#1
0
        private networkManager(incomingLineEventHandler incomingDriveLineHandler, incomingLineEventHandler incomingEngineeringLineHandler, incomingLineEventHandler incomingArmLineHandler, incomingLineEventHandler incomingLogisticsLineHandler)
        {
            //Drive networking setup
            incomingDrive = incomingDriveLineHandler;
            DRIVECOM = new commSockSender("DRIVECOM");
            DRIVECOM.incomingLineEvent += DRIVECOM_incomingLineEvent;
            DRIVECOM.connectionStatusChanged += DRIVECOM_connectionStatusChanged;
            DRIVECOM.beginConnect(rocConstants.MCIP_DRIVE, rocConstants.MCPORT_DRIVE);

            //Engineering networking setup
            incomingEngineering = incomingEngineeringLineHandler;
            ENGCOM = new commSockSender("ENGCOM");
            ENGCOM.incomingLineEvent += ENGCOM_incomingLineEvent;
            ENGCOM.connectionStatusChanged += ENGCOM_connectionStatusChanged;
            ENGCOM.beginConnect(rocConstants.MCIP_ENG, rocConstants.MCPORT_ENGINEERING);

            //Arm networking setup
            incomingArm = incomingArmLineHandler;
            ARMCOM = new commSockSender("ARMCOM");
            ARMCOM.incomingLineEvent +=ARMCOM_incomingLineEvent;
            ARMCOM.connectionStatusChanged +=ARMCOM_connectionStatusChanged;
            ARMCOM.beginConnect(rocConstants.MCIP_ARM, rocConstants.MCPORT_ARM);

            //Logistics networking setup
            incomingLogistics = incomingLogisticsLineHandler;
            LOGCOM = new commSockSender("LOGCOM");
            LOGCOM.incomingLineEvent += LOGCOM_incomingLineEvent;
            LOGCOM.connectionStatusChanged += LOGCOM_connectionStatusChanged;
            LOGCOM.beginConnect(rocConstants.MCIP_LOGISTICS, rocConstants.MCPORT_LOGISTICS);

        }
示例#2
0
 public static networkManager getInstance(incomingLineEventHandler incomingDriveLineHandler, incomingLineEventHandler incomingEngineeringLineHandler, incomingLineEventHandler incomingArmLineHandler, incomingLineEventHandler incomingLogisticsLineHandler)
 {
     if (NM != null)
     {
         return NM;
     }
     else
     {
         NM = new networkManager(incomingDriveLineHandler, incomingEngineeringLineHandler, incomingArmLineHandler, incomingLogisticsLineHandler);
         return NM;
     }
 }