Exemple #1
0
        public BACnetManager(AppManager apm, OurSocket insidesocket, int deviceID, IPEndPoint destination)
        {
            _apm = apm;

            this.ourdeviceID  = deviceID;
            this.insideSocket = insidesocket;

            // Establish our own IP address, port

            String strHostName = Dns.GetHostName();

            this.OurIPAddressEntry = Dns.GetHostEntry(strHostName);
            this.OurIPAddressList  = this.OurIPAddressEntry.AddressList;



            // fire up a thread to watch for incoming packets

            BAClistener_insideobject = new BACnetListener(_apm, this)
            {
                listen_socket = insidesocket
            };
            BAClistener_insidethread = new Thread(new ThreadStart(BAClistener_insideobject.BACnetInsideListener));
            BAClistener_insidethread.Start();
        }
        public BACnetManager(AppManager apm, int BACnetManagerPort)
        {
            _apm = apm;

            this.BACnetManagerPort = BACnetManagerPort;

            // Establish our own IP address, port

            String strHostName = Dns.GetHostName();

            this.OurIPAddressEntry = Dns.GetHostEntry(strHostName);
            this.OurIPAddressList  = this.OurIPAddressEntry.AddressList;

            // fire up a thread to watch for incoming packets

            BAClistener_object = new BACnetListener(_apm, this, BACnetManagerPort);

            BAClistener_thread = new Thread(new ThreadStart(BAClistener_object.BACnetListenerMethod));
            BAClistener_thread.Start();
        }