public ISocket CreateSocket()
        {
            var socket = new StubSocket();
            sockets.Add(socket);

            return socket;
        }
 private void Wait(StubSocket socket)
 {
     if (socket == null)
     {
         Thread.Sleep(socketWaitTimeout);
     }
 }
        public ISocket CreateSocket()
        {
            var socket = new StubSocket();
            sockets.Add(new SocketMeta
                        {
                            Socket = socket,
                            Purpose = GetSocketPurpose()
                        }
                );

            return socket;
        }
        public ISocket CreateSocket()
        {
            var socket = new StubSocket();
            sockets.Add(new SocketMeta
                        {
                            Socket = socket,
                            IsRegistrationSocket = IsRegistrationSocket()
                        }
                );

            return socket;
        }
        private static IMessage SendMessageOverMessageHub()
        {
            var messageTracer = new Mock<kino.Client.IMessageTracer>();
            var logger = new Mock<ILogger>();
            var sockrtFactory = new Mock<ISocketFactory>();
            var socket = new StubSocket();
            sockrtFactory.Setup(m => m.CreateDealerSocket()).Returns(socket);

            var message = Message.CreateFlowStartMessage(new SimpleMessage(), SimpleMessage.MessageIdentity);
            var callback = new CallbackPoint(SimpleMessage.MessageIdentity);

            var messageHub = new MessageHub(sockrtFactory.Object,
                                            new CallbackHandlerStack(new ExpirableItemCollection<CorrelationId>(logger.Object)),
                                            new MessageHubConfiguration(),
                                            messageTracer.Object,
                                            logger.Object);
            messageHub.Start();
            messageHub.EnqueueRequest(message, callback);
            Thread.Sleep(AsyncOpCompletionDelay);

            return socket.GetSentMessages().BlockingLast(AsyncOpCompletionDelay);
        }