示例#1
0
        public Client(int port)
        {
            _MessageDeliverer = _CoapServer.MessageDeliverer;
            _CoapServer.MessageDeliverer = this;
            //_EndPoint = new CoAPEndPoint(port, CoapConfig.Default);

            //_EndPoint = new CoAPEndPoint(new FlowClientSecureChannel(port), CoapConfig.Default);
            //_EndPoint = new CoAPEndPoint(new FlowChannel(port), CoapConfig.Default);

            _Channel = new FlowClientChannel(port);

            UseCertificateFile("Client.pem");

            _EndPoint = new CoAPEndPoint(_Channel, CoapConfig.Default);
            _CoapServer.AddEndPoint(_EndPoint);
            _CoapServer.Add(_SecurityResources);
            _CoapServer.Add(_ServerResources);
            _CoapServer.Add(_BootsrapComplete);
            _Root = _BootsrapComplete.Parent;
            _Timer.Interval = 30000;
            _Timer.Elapsed += new System.Timers.ElapsedEventHandler(_Timer_Elapsed);
        }
示例#2
0
        public Client(int port)
        {
            _MessageDeliverer            = _CoapServer.MessageDeliverer;
            _CoapServer.MessageDeliverer = this;
            //_EndPoint = new CoAPEndPoint(port, CoapConfig.Default);

            //_EndPoint = new CoAPEndPoint(new FlowClientSecureChannel(port), CoapConfig.Default);
            //_EndPoint = new CoAPEndPoint(new FlowChannel(port), CoapConfig.Default);

            _Channel = new FlowClientChannel(port);

            UseCertificateFile("Client.pem");

            _EndPoint = new CoAPEndPoint(_Channel, CoapConfig.Default);
            _CoapServer.AddEndPoint(_EndPoint);
            _CoapServer.Add(_SecurityResources);
            _CoapServer.Add(_ServerResources);
            _CoapServer.Add(_BootsrapComplete);
            _Root           = _BootsrapComplete.Parent;
            _Timer.Interval = 30000;
            _Timer.Elapsed += new System.Timers.ElapsedEventHandler(_Timer_Elapsed);
        }