コード例 #1
0
ファイル: MessagHubTests.cs プロジェクト: gitter-badger/kino
 public void Setup()
 {
     callbackHandlerStack = new Mock<ICallbackHandlerStack>();
     loggerMock = new Mock<ILogger>();
     logger = new Logger("default");
     messageHubSocketFactory = new MessageHubSocketFactory();
     socketFactory = new Mock<ISocketFactory>();
     socketFactory.Setup(m => m.CreateDealerSocket()).Returns(messageHubSocketFactory.CreateSocket);
     config = new MessageHubConfiguration
              {
                  RouterUri = new Uri(localhost)
              };
     messageTracer = new Mock<IMessageTracer>();
 }
コード例 #2
0
ファイル: MessageHub.cs プロジェクト: gitter-badger/kino
 public MessageHub(ISocketFactory socketFactory,
                   ICallbackHandlerStack callbackHandlers,
                   MessageHubConfiguration config,
                   IMessageTracer messageTracer,
                   ILogger logger)
 {
     this.logger = logger;
     this.messageTracer = messageTracer;
     this.socketFactory = socketFactory;
     this.config = config;
     receivingSocketIdentityPromise = new TaskCompletionSource<byte[]>();
     hubRegistered = new ManualResetEventSlim();
     this.callbackHandlers = callbackHandlers;
     registrationsQueue = new BlockingCollection<CallbackRegistration>(new ConcurrentQueue<CallbackRegistration>());
     cancellationTokenSource = new CancellationTokenSource();
 }