Start() 공개 메소드

public Start ( ) : void
리턴 void
예제 #1
0
파일: Server.cs 프로젝트: gwupe/Gwupe
 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();
 }
예제 #2
0
파일: Client.cs 프로젝트: gwupe/Gwupe
 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;
 }