Beispiel #1
0
        public void Connect(IPAddress address, int inPort, int outPort)
        {
            sender = new PainterSender(lanCanvas, LocalName);
            sender.Connect(address, outPort);
            ServerHandle = sender.Handle;
            TcpListener listener = new TcpListener(IPAddress.Any, inPort);

            listener.Start();
            TcpClient remote = listener.AcceptTcpClient();

            listener.Stop();
            receiver       = new PainterReceiver(remote, lanCanvas);
            RemoteName     = receiver.RemoteName;
            Permissions    = receiver.Permissions;
            ReceiverHandle = receiver.Handle;

            setupHandlers();
        }
Beispiel #2
0
        public void Listen(IPAddress address, int inPort, int outPort)
        {
            TcpListener listener = new TcpListener(address, inPort);

            listener.Start();
            TcpClient remote = listener.AcceptTcpClient();

            listener.Stop();
            receiver       = new PainterReceiver(remote, lanCanvas);
            Permissions    = receiver.Permissions;
            RemoteName     = receiver.RemoteName;
            ReceiverHandle = receiver.Handle;
            sender         = new PainterSender(lanCanvas, LocalName);
            IPEndPoint endpoint = (IPEndPoint)remote.Client.RemoteEndPoint;

            sender.Connect(endpoint.Address, outPort);
            ServerHandle = sender.Handle;

            setupHandlers();
        }
Beispiel #3
0
 public ServerHandle(PainterSender painterSender)
 {
     this.painterSender = painterSender;
 }