Esempio n. 1
0
        public static void Main(string[] args)
        {
            if (args == null || args.Length != 1)
            {
                throw new ArgumentException("Expected 1 argument with zmq connection information file");
            }
            var conn = GetConnectionInformation(args[0]);

            var signatureAlgorithm = conn.SignatureScheme.Replace("-", "").ToUpperInvariant();
            var signatureValidator = new SignatureValidator(conn.Key, signatureAlgorithm);

            MessageSender.Initialize(signatureValidator);

            // Start the shell
            new Thread(() => StartShellLoop(conn.ShellAddress, conn.IoPubAddress)).Start();
            Log.Info("Shell started");

            // Start the heartbeat
            new Thread(() => StartHeartbeatLoop(conn.HeartbeatAddress)).Start();
            Log.Info("Heartbeat started");

            StopEvent.Wait();
            Thread.Sleep(60000);
        }