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); }
public void SetUp() { wh = new ManualResetEventSlim(); schedulerDelegate = new SchedulerDelegate(); schedulerDelegate.OnStoppedAction = () => wh.Set(); scheduler = new DefaultKayakScheduler(schedulerDelegate); }
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); }
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); }
public void SetUp() { wh = new ManualResetEventSlim(); schedulerDelegate = new SchedulerDelegate(); schedulerDelegate.OnStoppedAction = () => wh.Set(); scheduler = new KayakScheduler(schedulerDelegate); }
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); }