Beispiel #1
0
        public void reverseConnect()
        {
            System.Net.IPAddress addr = publicAddress;

            var t = attemptConnection();

            if (t != null)
            {
                ReliableIncomingConnection c = new ReliableIncomingConnection(t);
                c.send(new Commands.ReverseConnectionType()
                {
                    makeControl = true, id = App.theCore.id
                });
                App.theCore.addIncomingConnection(c);
            }
            t = attemptConnection();
            if (t != null)
            {
                ReliableIncomingConnection c = new ReliableIncomingConnection(t);
                c.send(new Commands.ReverseConnectionType()
                {
                    makeData = true, id = App.theCore.id
                });
                App.theCore.addIncomingConnection(c);
            }
        }
Beispiel #2
0
 //TODO: Remove old incoming connections when they're dead
 static void acceptLoop()
 {
     while (!disposed)
     {
         System.Net.Sockets.TcpClient u = listener.AcceptTcpClient();
         Model.IncomingConnection     c = new Model.ReliableIncomingConnection(u);
         theCore.addIncomingConnection(c);
     }
 }