Ejemplo n.º 1
0
        /// <summary>
        /// Verbindet den eingehenden Datenstrom.
        /// </summary>
        /// <param name="host">Optionale Multicast Adresse für den Empfang.</param>
        /// <param name="port">TCP/IP Port, an dem die Daten entgegen genommen werden sollen.</param>
        /// <param name="server">Optionale Angabe des VCR.NET Servers.</param>
        protected void Connect( string host, ushort port, string server )
        {
            // The endpoint
            TransportStreamReceiver endPoint;

            // Host name to use
            if (string.IsNullOrEmpty( host ))
            {
                // Find us
                var self = Dns.GetHostEntry( Dns.GetHostName() );
                if (string.IsNullOrEmpty( server ))
                {
                    // Use us
                    host = self.HostName;
                }
                else
                {
                    // Check for local access
                    var remote = Dns.GetHostEntry( server );

                    // See if these are the same
                    host = StringComparer.InvariantCultureIgnoreCase.Equals( self.HostName, remote.HostName ) ? "localhost" : self.HostName;
                }

                // Use Unicast mode
                endPoint = new TransportStreamReceiver( port );

                // Where to connect to
                m_Target = string.Format( "{0}:{1}", host, endPoint.Port );
            }
            else
            {
                // Use Multicast mode
                endPoint = new TransportStreamReceiver( IPAddress.Parse( host ), port );

                // Where to connect to
                m_Target = string.Format( "*{0}:{1}", host, endPoint.Port );
            }

            // Register accessor
            SetAccessor( endPoint );

            // Register with accessor
            ConnectWaiter();

            // Finsihed
            OnConnected();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Wird immer aufgerufen, wenn innerhalb des Zugriffsmoduls neue Daten angefordert
 /// werden.
 /// </summary>
 /// <param name="endPoint">Aktuelles Zugriffsmodul.</param>
 protected virtual void OnWaitData( TransportStreamReceiver endPoint )
 {
     // No longer needed
     DisconnectWaiter();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Wird aufgerufen, wenn das Zugriffsmodul Daten anfordert.
 /// </summary>
 /// <param name="endPoint">Das anfordernde Zugriffsmodul.</param>
 protected override void OnWaitData( TransportStreamReceiver endPoint )
 {
     // Load connector
     var connector = m_CurrentConnector;
     if (connector != null)
         connector.OnWaitData();
 }