Example #1
0
        public void SetUp()
        {
            ep = new IPEndPoint(IPAddress.Loopback, Config.Port);

            wh = new ManualResetEventSlim();

            schedulerDelegate = new SchedulerDelegate();
            scheduler         = new DefaultKayakScheduler(schedulerDelegate);

            schedulerDelegate.OnStoppedAction = () =>
            {
                stopListening.Dispose();
                stopListening = null;
                wh.Set();
            };
            schedulerDelegate.OnExceptionAction = e =>
            {
                schedulerError = e;
                Debug.WriteLine("Error on scheduler");
                e.DebugStackTrace();
                scheduler.Stop();
            };

            scheduler.Post(() =>
            {
                stopListening = server.Listen(ep);
                schedulerStartedAction();
            });

            serverDelegate = new ServerDelegate();
            server         = new DefaultKayakServer(serverDelegate, scheduler);

            clientSocketDelegate = new SocketDelegate();
            client = new DefaultKayakSocket(clientSocketDelegate, scheduler);
        }
Example #2
0
        public void SetUp()
        {
            wh = new ManualResetEventSlim();

            schedulerDelegate = new SchedulerDelegate();
            schedulerDelegate.OnStoppedAction = () => wh.Set();
            scheduler = new DefaultKayakScheduler(schedulerDelegate);
        }
Example #3
0
        public void SetUp()
        {
            wh = new ManualResetEventSlim();
            var schedulerDelegate = new SchedulerDelegate();
            schedulerDelegate.OnStoppedAction = () => wh.Set();
            var scheduler = new KayakScheduler(schedulerDelegate);

            var serverDelegate = new ServerDelegate();
            server = KayakServer.Factory.Create(serverDelegate, scheduler);
        }
Example #4
0
        public void SetUp()
        {
            wh = new ManualResetEventSlim();
            var schedulerDelegate = new SchedulerDelegate();
            schedulerDelegate.OnStoppedAction = () => wh.Set();
            var scheduler = new DefaultKayakScheduler(schedulerDelegate);
            schedulerDelegate.OnExceptionAction = e =>
            {
                Debug.WriteLine("Error on scheduler");
                e.DebugStackTrace();
                scheduler.Stop();
            };

            var serverDelegate = new ServerDelegate();
            server = new DefaultKayakServer(serverDelegate, scheduler);
        }
Example #5
0
        public void SetUp()
        {
            wh = new ManualResetEventSlim();
            var schedulerDelegate = new SchedulerDelegate();

            schedulerDelegate.OnStoppedAction = () => wh.Set();
            var scheduler = new DefaultKayakScheduler(schedulerDelegate);

            schedulerDelegate.OnExceptionAction = e =>
            {
                Debug.WriteLine("Error on scheduler");
                e.DebugStackTrace();
                scheduler.Stop();
            };

            var serverDelegate = new ServerDelegate();

            server = new DefaultKayakServer(serverDelegate, scheduler);
        }
Example #6
0
        public void SetUp()
        {
            ep = new IPEndPoint(IPAddress.Loopback, Config.Port);

            wh = new ManualResetEventSlim();

            schedulerDelegate = new SchedulerDelegate();
            scheduler = new DefaultKayakScheduler(schedulerDelegate);

            schedulerDelegate.OnStoppedAction = () =>
            {
                stopListening.Dispose();
                stopListening = null;
                wh.Set();
            };
            schedulerDelegate.OnExceptionAction = e =>
            {
                schedulerError = e;
                Debug.WriteLine("Error on scheduler");
                e.DebugStackTrace();
                scheduler.Stop();
            };

            scheduler.Post(() =>
            {
                stopListening = server.Listen(ep);
                schedulerStartedAction();
            });

            serverDelegate = new ServerDelegate();
            server = new DefaultKayakServer(serverDelegate, scheduler);

            clientSocketDelegate = new SocketDelegate();
            client = new DefaultKayakSocket(clientSocketDelegate, scheduler);
        }
Example #7
0
        public void SetUp()
        {
            wh = new ManualResetEventSlim();

            schedulerDelegate = new SchedulerDelegate();
            schedulerDelegate.OnStoppedAction = () => wh.Set();
            scheduler = new KayakScheduler(schedulerDelegate);
        }
Example #8
0
        public void SetUp()
        {
            ep = new IPEndPoint(IPAddress.Loopback, Config.Port);

            wh = new ManualResetEventSlim();

            IDisposable d = null;

            var schedulerDelegate = new SchedulerDelegate();
            schedulerDelegate.OnStoppedAction = () =>
            {
                d.Dispose();
                wh.Set();
            };

            scheduler = new KayakScheduler(schedulerDelegate);
            scheduler.Post(() =>
            {
                d = server.Listen(ep);
                schedulerStartedAction();
            });

            var serverDelegate = new ServerDelegate();
            server = new KayakServer(serverDelegate, scheduler);

            clientSocketDelegate = new SocketDelegate();
            client = new KayakSocket(clientSocketDelegate, scheduler);
        }