/** * 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(); }
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 (); }
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(); }