Ejemplo n.º 1
0
 public Publisher(string announceIp, int port)
 {
     this.AnnounceIp = announceIp;
     this.AnnouncePort = port;
     sendSocket = new UdpSource(announceIp, port);
     writer = new BatchWriter(sendSocket, 1024*128);
     publisher = new TopicPublisher(writer);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        private void SendHostConfigQuery()
        {
            PgmSource sendSocket = new PgmSource("224.0.0.23", 7272);
            sendSocket.Start();

            BatchWriter asyncWriter = new BatchWriter(sendSocket, 1024 * 128);

            TopicPublisher publisher = new TopicPublisher(asyncWriter);
            publisher.Start();

            int sendTimeout = 1000;
            publish.PublishObject("Stock-Quotes-AAPL", 123.3, sendTimeout);
        }