Esempio n. 1
0
 private void ReceiveConnection(ISocket socket)
 {
     Socket = socket;
     Socket.ConnectionOpened += (sender, args) => { Closed = false; };
     Socket.ConnectionClosed += (sender, args) => Close();
     _proxy = new StreamProxy(Socket, new BmTcpSocket(new IPEndPoint(IPAddress.Loopback, VNCPort)));
     _proxy.Start();
 }
Esempio n. 2
0
 internal int Start(String connectionId)
 {
     // First we need p2p connection
     Socket = GwupeClientAppContext.CurrentAppContext.P2PManager.GetP2PConnection(SecondParty, connectionId);
     // Now we need to create a proxy
     var tcpSocket = new BmTcpSocket(new IPEndPoint(IPAddress.Any,0));
     tcpSocket.BindListen();
     _proxy = new StreamProxy(tcpSocket, Socket);
     Socket.ConnectionOpened += (sender, args) => { Closed = false; };
     Socket.ConnectionClosed += (sender, args) => Close();
     _proxy.Start();
     Thread.Sleep(5000); // sometimes we connect before the listener has started listening, pause here.
     LocalEndPoint = tcpSocket.LocalEndPoint;
     return tcpSocket.LocalEndPoint.Port;
 }
Esempio n. 3
0
 internal override void Close()
 {
     if (!Closing && !Closed)
     {
         Logger.Debug("Closing RemoteDesktop Proxy to local service");
         Closing = true;
         if (_proxy != null)
         {
             _proxy.Close();
         }
         Closing = false;
         Closed = true;
         _proxy = null;
     }
 }
Esempio n. 4
0
 // This is called by the RDP Function, so stop listening and terminate connections
 internal override void Close()
 {
     if (!Closing && !Closed)
     {
         Logger.Debug("Closing RemoteDesktop ServerProxy");
         Closing = true;
         if (_proxy != null)
         {
             _proxy.Close();
         }
         _proxy = null;
         Closing = false;
         Closed = true;
     }
 }