Example #1
0
        public void Start()
        {
            _socket.SendBufferSize = _sendBufferSize;

            IPEndPoint endpoint     = _uri.ResolveHostName().Single();
            IPEndPoint bindEndpoint = GetBindEndpoint();

            Trace.WriteLine("Binding producer to address: " + endpoint);
            _socket.Bind(bindEndpoint);

            _socket.EnableHighSpeed();

            Trace.WriteLine("Connecting producer to address: " + endpoint);
            _socket.Connect(endpoint);
        }
        public void Start()
        {
            _ts.TraceEvent(TraceEventType.Start, 100, "Starting listener on {0}", _multicastAddress);

            _socket.ReceiveBufferSize = ReceiveBufferSize;

            IPEndPoint multicastEndpoint = _multicastAddress.ResolveHostName().Single();

            _socket.Bind(multicastEndpoint);

            _ts.TraceEvent(TraceEventType.Verbose, 0, "Bind listener to {0} complete", multicastEndpoint);

            AddAdditionalInterfaces();

            _socket.EnableHighSpeed();
            _socket.Listen(3);

            _socket.BeginAccept(AcceptConnection, null);

            _ts.TraceEvent(TraceEventType.Stop, 100, "Listener started on {0}", _multicastAddress);
        }