Beispiel #1
0
 public GroupMulticast(PointToPointInterface transmitter)
 {
     m_transmitter = transmitter;
 }
        /**
         * Start a remote listening interface on a specific port
         * Servers: use unique ports
         * Clients: may use same port (unless run on same machine)
         */
        public bool Start(SendReceiveMiddleLayer demuxer, int port)
        {
            if (demuxer == null)
            {
                DebugFatal ("Received null demuxer");
            }

            // Default is active
            Paused = false;

            m_channelProperties["port"] = port.ToString ();

            string useDummyRecipient = ConfigReader.GetConfigurationValue ("dummyrecipient");
            if (useDummyRecipient != null && useDummyRecipient.Equals ("true"))
            {
                m_dummy = new DummyPointToPointSend ();
                m_dummy.Init (demuxer);
            }
            // create sending interfaces
            m_pointToPoint = new PointToPointInterface ();
            m_pointToPoint.Init (demuxer);

            // register tcp channel and connect p2p interface
            m_channel = new TcpChannel (m_channelProperties, null, null);
            ChannelServices.RegisterChannel (m_channel, false);
            m_marshalRef = RemotingServices.Marshal (m_pointToPoint, CHANNEL_NAME, typeof(PointToPointInterface));

            return true;
        }