public ProcessingThread() { network = G2Network.Instance; cache = GHubCache.Instance; SearchManager = G2SearchManager.Instance; processThread = new Thread(new ThreadStart(Process)); processThread.Name = "Processing Thread "; }
public ProcessingThread() { network = G2Network.Instance; cache = GHubCache.Instance; SearchManager = G2SearchManager.Instance; processThread = new Thread (new ThreadStart (Process)); processThread.Name = "Processing Thread "; }
/** * Launch the sockets thread and the processing threads * */ public void StartNetwork() { G2Log.Write("G2Network : Starting network processes ... "); process = ProcessingThread.Instance; cache = GHubCache.Instance; process.Start(); // start a few connections for (int i = 0; i < Settings.PEER_DISPATCH_QUERY; i++) { ConnectToRandomHub(); } }
private void HandleHub(HttpHeader header) { IPAddress _listen_ip = IPAddress.Parse(header[HttpHeader.LISTEN_IP_KEY]); ushort _listen_port = Convert.ToUInt16(header[HttpHeader.LISTEN_PORT_KEY]); string encoding = header[HttpHeader.ACCEPT_ENCODING_KEY]; string _remote_ip = header[HttpHeader.REMOTE_IP_KEY]; GHubCache cache = GHubCache.Instance; IPAddress self = IPAddress.Parse(_remote_ip); G2Network.Instance.SelfAddress = self; if (_listen_ip != null && _listen_port > 0 && _listen_port < 65000) { remote_host = new NodePeer(_listen_ip, _listen_port, DateTime.Now.ToString(), true); } }
/** * Launch the sockets thread and the processing threads * */ public void StartNetwork() { G2Log.Write ("G2Network : Starting network processes ... "); process = ProcessingThread.Instance; cache = GHubCache.Instance; process.Start(); // start a few connections for (int i = 0; i < Settings.PEER_DISPATCH_QUERY; i++) { ConnectToRandomHub(); } }