Ejemplo n.º 1
0
 public void Initialize()
 {
     _theServer = new IrisServer();
     _theServer.Start(56666);
     _theClientConfig = new IrisClientConfig()
     {
         Hostname = "127.0.0.1", Port = 56666
     };
 }
Ejemplo n.º 2
0
        private static void PerfTest()
        {
            string channel = "perf";

            IrisServer server = new IrisServer();

            server.Start(22000);
            Console.WriteLine("Server started");

            IrisLocalNode echoNode = new IrisLocalNode();

            echoNode.Connect(server.GetServerConfig());
            Console.WriteLine("Echo node connected");

            echoNode.OnDisposed += () =>
            {
                server.Stop();
            };

            System.Threading.Tasks.Task <IDisposableSubscription> asyncSubscription = null;
            asyncSubscription = echoNode.Subscribe(channel, (c, h) =>
            {
                if (!h.Unsubscribing)
                {
                    var echoMessage = $"ECHO: {c}";
                    echoNode.Publish(channel, echoMessage);

                    if ((c as Test)?.Data == null && (c as Test)?.Message == null)
                    {
                        var sub = asyncSubscription.Result;
                        sub.Dispose();
                    }
                }
                else
                {
                    echoNode.Dispose();
                }
            });
        }
Ejemplo n.º 3
0
        public void ServerIdAreUnique()
        {
            var otherServer = new IrisServer();

            Assert.AreNotEqual(otherServer.Id, _theServer.Id);
        }
Ejemplo n.º 4
0
 public void Initialize()
 {
     _theServer = new IrisServer();
 }