Start() public method

public Start ( ) : void
return void
Exemplo 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();
 }
Exemplo 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;
 }