private void OpenPort_OnExecuted(object sender, ExecutedRoutedEventArgs e) { _comService = new CommunicateService(MessageParserFactory.GetParserByProtocal(TransponderType.Robitronic)); var portSetting = new SerialPortSettings(38400, System.IO.Ports.StopBits.One, System.IO.Ports.Parity.None, 8); _comService.StartService(ComSelection.Text, portSetting); }
public void Start() { factory = new MessageParserFactory(); MessageParser parser = factory.Create(); receiveSocket = new UdpReceiver(ListenToIp, ListeToPort); receiveSocket.ReceiveEvent += parser.OnBytes; receiveSocket.Start(); }
public Subscriber(string listenToIp, int listenToPort) { this.ListenToIp = listenToIp; this.ListeToPort = listenToPort; factory = new MessageParserFactory(); parser = factory.Create(); receiveSocket = new UdpReceiver(ListenToIp, ListeToPort); receiveSocket.ReceiveEvent += parser.OnBytes; }
public PgmMulticastingChannel(string address, int port) { MessageParserFactory = new MessageParserFactory(); var reader = new PgmReader(MessageParserFactory); var receiveSocket = new PgmReceiver(address, port, reader); receiveSocket.Start(); var sendSocket = new PgmSource(address, port); sendSocket.Start(); var asyncWriter = new BatchWriter(sendSocket, 1500); TopicPublisher = new TopicPublisher(asyncWriter); TopicPublisher.Start(); _disposables.Add(receiveSocket); _disposables.Add(sendSocket); }
public UdpMulticastingChannel(string address, int port) { MessageParserFactory = new MessageParserFactory(); MessageParser parser = MessageParserFactory.Create(); UdpReceiver receiveSocket = new UdpReceiver(address, port); receiveSocket.ReceiveEvent += parser.OnBytes; receiveSocket.Start(); var sendSocket = new UdpSource(address, port); sendSocket.Start(); var asyncWriter = new DaemonWritter(sendSocket); //var asyncWriter = new BatchWriter(sendSocket,1500); TopicPublisher = new TopicPublisher(asyncWriter); TopicPublisher.Start(); _disposables.Add(receiveSocket); _disposables.Add(sendSocket); }