public ClusteringPhase CreateGuestPhase(LocalServiceContainer localServiceContainer, IConnectedSocket clientSocket)
        {
            var pofStream     = pofStreamsFactory.CreatePofStream(clientSocket.Stream);
            var pofDispatcher = pofStreamsFactory.CreateDispatcher(pofStream);
            var messageSender = new MessageSenderImpl(pofStream.Writer, portableObjectBoxConverter);
            var phase         = new GuestPhase(
                this,
                localServiceContainer,
                clusteringPhaseManager,
                messageSender,
                pofDispatcher,
                collectionFactory.CreateUniqueIdentificationSet(true),
                collectionFactory.CreateConcurrentDictionary <uint, AsyncValueBox>()
                );

            phase.Initialize();
            return(phase);
        }
Пример #2
0
        public HostSession Create(HostContext hostContext, IConnectedSocket socket)
        {
            var shutdownCancellationTokenSource = threadingProxy.CreateCancellationTokenSource();
            var pofStream     = pofStreamsFactory.CreatePofStream(socket.Stream);
            var pofDispatcher = pofStreamsFactory.CreateDispatcher(pofStream);
            var messageSender = new MessageSenderImpl(pofStream.Writer, portableObjectBoxConverter);
            var session       = new HostSessionImpl(
                hostContext,
                shutdownCancellationTokenSource,
                messageSender,
                pofDispatcher,
                collectionFactory.CreateConcurrentSet <Guid>(),
                collectionFactory.CreateUniqueIdentificationSet(true),
                collectionFactory.CreateConcurrentDictionary <uint, AsyncValueBox>()
                );

            session.Initialize();
            return(session);
        }