Пример #1
0
        async void device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e)
        {
            e.Accept();

            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, (() =>
            {
                activated = true;
                CallPoster.Visibility = Visibility.Collapsed;
                RemoteVideo.Visibility = Visibility.Visible;

                var remoteAddress = e.RemoteUrl;
                EndCall.IsEnabled = true;
                Interlocked.Exchange(ref isTerminator, 0);

                if (!((bool)roleIsActive))
                {
                    // Passive client
                    RemoteVideo.Source = new Uri(remoteAddress);
                    HostName.IsEnabled = Call.IsEnabled = false;
                }

                remoteAddress = remoteAddress.Replace("stsp://", "");
                rootPage.NotifyUser("Connected. Remote machine address: " + remoteAddress, NotifyType.StatusMessage);
            }));
        }
Пример #2
0
        async void Device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e)
        {
            e.Accept();
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, (() =>
            {
                OutgoingCall.Visibility = Visibility.Collapsed;
                OutgoingCall.Stop();
                RemoteVideo.Visibility = Visibility.Visible;
            }));


            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, (() =>
            {
                activated = true;
                var remoteAddress = e.RemoteUrl;

                btnEndConsult.IsEnabled = true;
                Interlocked.Exchange(ref isTerminator, 0);

                if (!((bool)roleIsActive))
                {
                    // Passive client
                    RemoteVideo.Source = new Uri(remoteAddress);
                    device = new CaptureDevice();
                    HostNameTextbox.IsEnabled = btnInitConsult.IsEnabled = false;
                }

                remoteAddress = remoteAddress.Replace("stsp://", "");
            }));
        }
Пример #3
0
 /// <summary>
 /// Handler for the wrapped media sink object's IncomingConnectionEvent. Expose the wrapped event to
 /// listeners as own IncomingConnectionArrived event.
 /// </summary>
 private void mediaSink_IncomingConnectionEvent(StspMediaSink sender, IncomingConnectionEventArgs args)
 {
     if (IncomingConnectionArrived != null && forwardEvents)
     {
         IncomingConnectionArrived(sender, args);
     }
 }
Пример #4
0
        async void device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e)
        {
            e.Accept();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, (() =>
            {
                _isRecording = true;
                NotifyUser("Connected. Remote machine address: " + e.RemoteUrl.Replace("stsp://", ""), NotifyType.StatusMessage);
            }));
        }
Пример #5
0
        async void Device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e)
        {
            incommingCall = e;

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, (() =>
            {
                IncomingCallRing.Play();
                Reject.Visibility = Visibility.Visible;
                Accept.Visibility = Visibility.Visible;
            }));
        }
Пример #6
0
 /// <summary>
 /// end the video call
 /// </summary>
 /// <returns></returns>
 async Task EndVideoCall()
 {
     try
     {
         incommingCall = null;
         if (Interlocked.CompareExchange(ref isTerminator, 1, 0) == 0)
         {
             await EndCallAsync();
         }
     }
     catch (Exception)
     { }
 }
Пример #7
0
        private void TcpConnectionListenerIncomingConnection(object sender, IncomingConnectionEventArgs e)
        {
            if (e.Socket.Connected)
            {
                var connLimit = Settings.ConnectionsLimit;

                if (connLimit != 0 && TransferManager.TransfersCount >= connLimit)
                {
                    Logger.Warn("Connection limit {0} reached, dropping incoming connection", connLimit);
                    return;
                }

                e.Handled = true;
                var transfer = new TransferConnection(e.Socket);
                TransferManager.AddTransfer(transfer);
                transfer.StartAsync();
            }
            else
            {
                Logger.Warn("We have disconnected incoming socket");
            }
        }
Пример #8
0
        void ListenerIncomingConnection(object sender, IncomingConnectionEventArgs e)
        {
            var ipEndPoint = (IPEndPoint)e.Socket.RemoteEndPoint;

            if (LocalMode && !IPAddress.IsLoopback(ipEndPoint.Address))
            {
                e.Socket.Dispose();
                return;
            }

            var conn = new ClientConnection(e.Socket);

            logger.Info("{0} connected", e.Socket.RemoteEndPoint);

            e.Handled = Add(conn);

            conn.Listen();

            if (!e.Handled)
            {
                logger.Warn("Disconnecting non handled connection {0}", e.Socket.RemoteEndPoint);
                conn.Dispose();
            }
        }
 void Device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e)
 {
     e.Accept();
 }
 void device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e)
 {
     e.Accept();
 }
Пример #11
0
 /// <summary>
 /// Handler for the wrapped media sink object's IncomingConnectionEvent. Expose the wrapped event to
 /// listeners as own IncomingConnectionArrived event.
 /// </summary>
 private void mediaSink_IncomingConnectionEvent(StspMediaSink sender, IncomingConnectionEventArgs args)
 {
     if (IncomingConnectionArrived != null && forwardEvents) IncomingConnectionArrived(sender, args);
 }
        async void device_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs e)
        {
            e.Accept();

            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, (() =>
            {
                activated = true;
                var remoteAddress = e.RemoteUrl;
                EndCall.IsEnabled = true;
                Interlocked.Exchange(ref isTerminator, 0);

                if (!((bool)roleIsActive))
                {
                    // Passive client
                    RemoteVideo.Source = new Uri(remoteAddress);
                    HostName.IsEnabled = Call.IsEnabled = false;
                }

                remoteAddress = remoteAddress.Replace("stsp://", "");
                rootPage.NotifyUser("Connected. Remote machine address: " + remoteAddress, NotifyType.StatusMessage);
            }));
        }
Пример #13
0
        private void OnIncomingConnection(object sender, IncomingConnectionEventArgs e)
        {
            TcpConnection connection = e.Connection;

            ListenPlayerJoining(connection);
        }
 private void Camera_IncomingConnectionArrived(object sender, IncomingConnectionEventArgs arg)
 {
     arg.Accept();
 }