internal SystemTray(KyruApplication app) { this.app = app; trayMenu = new ContextMenu(); trayMenu.MenuItems.Add("Log in", OnLogin); trayMenu.MenuItems.Add("Connect", OnRegisterNode); trayMenu.MenuItems.Add("-"); trayMenu.MenuItems.Add("System status", OnSystemStatus); trayMenu.MenuItems.Add("-"); trayMenu.MenuItems.Add("Exit", OnExit); trayIcon = new NotifyIcon(); nodesIcon = new List<Icon>(); for (int i = 0; i < 4; i++){ nodesIcon.Add(new Icon("Icons/kyru"+ i.ToString() + ".ico")); } //TimerElapsed(); trayIcon.MouseDoubleClick += OnLogin; trayIcon.ContextMenu = trayMenu; trayIcon.Visible = true; TimerElapsed(); KyruTimer.Register(this, 2); }
private void CreateNodes() { nodes = new List<Node>(); for (int i = 0; i < NodeCount; i++) { var port = (ushort) (12000 + i); var node = new KyruApplication(port).Node; node.Start(); nodes.Add(node); if (i != 0) { node.Kademlia.AddNode(new IPEndPoint(IPAddress.Loopback, port - 1)); } Thread.Sleep(TestParameters.LocalhostCommunicationTimeout * 5); } KyruTimer.Start(); this.Warn("Waiting for the node initialization dust to settle...\n\n\n\n"); Thread.Sleep(TestParameters.LocalhostCommunicationTimeout * 160); this.Warn("Continuing...\n\n\n\n"); }
internal StoreObjectClient(KyruApplication app, NodeInformation targetNode, KademliaId objectId, byte[] bytes, Action<Error> done) : base(app, targetNode) { this.objectId = objectId; this.bytes = bytes; this.done = done; }
internal Node(ushort port, KyruApplication app) { Port = port; this.app = app; MetadataStorage = new MetadataStorage(this); Kademlia = new Kademlia(this); udp = new UdpClient(port); tcp = new TcpListener(IPAddress.Any, port); KyruTimer.Register(this, 1); }
private static void Main() { Console.WriteLine("Kyru debug console"); Console.WriteLine(); KyruTimer.Start(); app = new KyruApplication(); app.Start(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); tray = new SystemTray(app); Application.Run(); }
protected ClientBase(KyruApplication app, NodeInformation targetNode) { App = app; TargetNode = targetNode; }
internal StoreObjectState(NetworkStream stream, KyruApplication app, StoreObjectRequest storeObjectRequest) { this.stream = stream; this.app = app; this.storeObjectRequest = storeObjectRequest; }
internal HandshakeState(TcpClient client, NetworkStream stream, KyruApplication app) { this.client = client; this.stream = stream; this.app = app; }
internal GetObjectState(NetworkStream stream, KyruApplication app, GetObjectRequest getObjectRequest) { this.stream = stream; this.app = app; this.getObjectRequest = getObjectRequest; }
internal GetObjectClient(KyruApplication app, NodeInformation targetNode, KademliaId objectId, Action<Error, byte[]> done) : base(app, targetNode) { this.objectId = objectId; this.done = done; }
internal Node(KyruApplication app) : this(12045, app) { }
internal SystemStatusForm(KyruApplication app) { this.app = app; InitializeComponent(); timer1_Tick(null, null); }