コード例 #1
0
ファイル: TreadmillService.cs プロジェクト: slater1/treadmill
 public TreadmillService(ITreadmillAdapter adapter, IUdpService metrics, ILogService log)
 {
     _adapter = adapter;
     _metrics = metrics;
     _log     = log;
     Task.Run(() => metrics.Serve(HandleMetricsChanged));
 }
コード例 #2
0
        public ComandosViewModel()
        {
            udpService = new UdpService();

            Title            = "Comando";
            Comandos         = new ObservableCollection <Comando>();
            LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand());
        }
コード例 #3
0
ファイル: UdpServer.cs プロジェクト: zwxu999/FastSocket.Net
 /// <summary>
 /// new
 /// </summary>
 /// <param name="port"></param>
 /// <param name="messageBufferSize"></param>
 /// <param name="_protocolHandler"></param>
 /// <param name="service"></param>
 /// <exception cref="ArgumentNullException">protocol is null.</exception>
 /// <exception cref="ArgumentNullException">service is null.</exception>
 public UdpServer(int port, int messageBufferSize,
                  IUdpProtocolHandler <TMessage> _protocolHandler,
                  IUdpService <TMessage> service)
 {
     this._port = port;
     this._messageBufferSize = messageBufferSize;
     this._protocolHandler   = _protocolHandler ?? throw new ArgumentNullException("protocol");
     this._service           = service ?? throw new ArgumentNullException("service");
 }
コード例 #4
0
        public ComandoDetail(ComandoDetailViewModel viewModel)
        {
            InitializeComponent();

            udpService = new UdpService();

            tcpService = new TcpService();

            BindingContext = this.viewModel = viewModel;
        }
コード例 #5
0
        /// <summary>
        /// new
        /// </summary>
        /// <param name="port"></param>
        /// <param name="messageBufferSize"></param>
        /// <param name="protocol"></param>
        /// <param name="service"></param>
        /// <exception cref="ArgumentNullException">protocol is null.</exception>
        /// <exception cref="ArgumentNullException">service is null.</exception>
        public UdpServer(int port, int messageBufferSize,
            Protocol.IUdpProtocol<TMessage> protocol,
            IUdpService<TMessage> service)
        {
            if (protocol == null) throw new ArgumentNullException("protocol");
            if (service == null) throw new ArgumentNullException("service");

            this._port = port;
            this._messageBufferSize = messageBufferSize;
            this._protocol = protocol;
            this._service = service;
        }
コード例 #6
0
        public NovoComando()
        {
            InitializeComponent();

            udpService = new UdpService();

            tcpService = new TcpService();

            Comando = new Comando
            {
                Send = "@ALTERNAR#",
                Port = 9999,
                IP   = "192.168.1.250"
            };

            BindingContext = this;
        }
コード例 #7
0
        public ComandoDetail()
        {
            InitializeComponent();

            Comando = new Comando
            {
                Send    = "@ALTERNAR",
                Receive = "Tem alguem ai?"
            };

            udpService = new UdpService();

            tcpService = new TcpService();

            viewModel = new ComandoDetailViewModel(Comando);

            BindingContext = viewModel;
        }
コード例 #8
0
        /// <summary>
        /// new
        /// </summary>
        /// <param name="port"></param>
        /// <param name="messageBufferSize"></param>
        /// <param name="receiveThreads"></param>
        /// <param name="protocol"></param>
        /// <param name="service"></param>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        /// <exception cref="ArgumentNullException">protocol is null.</exception>
        /// <exception cref="ArgumentNullException">service is null.</exception>
        public UdpServer(int port, int messageBufferSize, int receiveThreads,
                         Protocol.IUdpProtocol <TCommandInfo> protocol,
                         IUdpService <TCommandInfo> service)
        {
            if (receiveThreads < 1)
            {
                throw new ArgumentOutOfRangeException("receiveThreads");
            }
            if (protocol == null)
            {
                throw new ArgumentNullException("protocol");
            }
            if (service == null)
            {
                throw new ArgumentNullException("service");
            }

            this._port = port;
            this._messageBufferSize = messageBufferSize;
            this._receiveThreads    = receiveThreads;
            this._protocol          = protocol;
            this._service           = service;
        }
コード例 #9
0
 /// <summary>
 /// new
 /// </summary>
 /// <param name="port"></param>
 /// <param name="protocol"></param>
 /// <param name="service"></param>
 public UdpServer(int port, Protocol.IUdpProtocol <TCommandInfo> protocol,
                  IUdpService <TCommandInfo> service)
     : this(port, 2048, 1, protocol, service)
 {
 }
コード例 #10
0
ファイル: UdpServer.cs プロジェクト: zwxu999/FastSocket.Net
 /// <summary>
 /// new
 /// </summary>
 /// <param name="port"></param>
 /// <param name="_protocolHandler"></param>
 /// <param name="service"></param>
 public UdpServer(int port, IUdpProtocolHandler <TMessage> _protocolHandler,
                  IUdpService <TMessage> service)
     : this(port, 2048, _protocolHandler, service)
 {
 }
コード例 #11
0
ファイル: UdpServer.cs プロジェクト: 371089003/test
 /// <summary>
 /// new
 /// </summary>
 /// <param name="port"></param>
 /// <param name="protocol"></param>
 /// <param name="service"></param>
 public UdpServer(int port, Protocol.IUdpProtocol <TMessage> protocol,
                  IUdpService <TMessage> service)
     : this(port, 2048, protocol, service)
 {
 }