Beispiel #1
0
 /**
  * Connection is made , handshake done
  * => change the connection type
  * => register itself in the connectedhub cache
  * => start timers
  * => send startup packets
  * */
 public void AttachTo(GHandshake hand)
 {
     this.connection = new HubSocket(this, hand.tcp.sock);
     this.connection.Start();
     GHubCache.Instance.AddConnectedHub(this);
     this.isHub = true;
     //StartTimers ();
     SendStartPackets();
 }
Beispiel #2
0
 public static void TestNetwork()
 {
     G2Network network = G2Network.Instance;
     network.StartNetwork ();
     NodePeer p = new NodePeer (IPAddress.Parse ("127.0.0.1"), 11000,0,false);
     Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     s.Connect (p.Address, p.Port);
     GHandshake hand = new GHandshake (p);
     hand.tcp.sock = s;
     p.AttachTo (hand);
     Thread.Sleep (10000);
     network.StopNetwork ();
 }
Beispiel #3
0
        public static void TestNetwork()
        {
            G2Network network = G2Network.Instance;

            network.StartNetwork();
            NodePeer p = new NodePeer(IPAddress.Parse("127.0.0.1"), 11000, 0, false);
            Socket   s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            s.Connect(p.Address, p.Port);
            GHandshake hand = new GHandshake(p);

            hand.tcp.sock = s;
            p.AttachTo(hand);
            Thread.Sleep(10000);
            network.StopNetwork();
        }