Beispiel #1
0
        public PeriodicResenderImpl(IThreadingProxy threadingProxy, UnacknowledgedReliableMessageContainer unacknowledgedReliableMessageContainer, MessageTransmitterImpl messageTransmitter)
        {
            this.threadingProxy = threadingProxy;
            this.unacknowledgedReliableMessageContainer = unacknowledgedReliableMessageContainer;
            this.messageTransmitter = messageTransmitter;

            this.cancellationTokenSource = threadingProxy.CreateCancellationTokenSource();
        }
Beispiel #2
0
 public PeriodicAnnouncerImpl(
     IThreadingProxy threadingProxy,
     IPofSerializer courierSerializer,
     ReadableCourierEndpoint localEndpoint,
     NetworkBroadcaster networkBroadcaster
     ) : this(
         threadingProxy.CreateCancellationTokenSource(),
         courierSerializer,
         localEndpoint,
         networkBroadcaster)
 {
 }
Beispiel #3
0
        public HostPhase(ICollectionFactory collectionFactory, IThreadingProxy threadingProxy, HostSessionFactory hostSessionFactory, HostContext hostContext, IListenerSocket listenerSocket)
        {
            this.threadingProxy     = threadingProxy;
            this.hostSessionFactory = hostSessionFactory;
            this.hostContext        = hostContext;
            this.listenerSocket     = listenerSocket;

            this.cancellationTokenSource = threadingProxy.CreateCancellationTokenSource();
            this.listenerThread          = threadingProxy.CreateThread(ListenerThreadEntryPoint, new ThreadCreationOptions {
                IsBackground = true
            });
            sessions = collectionFactory.CreateConcurrentSet <HostSession>();
        }
 public PofDispatcherImpl(
     IThreadingProxy threadingProxy,
     PofStreamReader reader,
     IConcurrentDictionary <Type, Action <object> > handlersByType,
     IConcurrentSet <Action> shutdownHandlers
     ) : this(
         reader,
         handlersByType,
         shutdownHandlers,
         threadingProxy.CreateCancellationTokenSource()
         )
 {
 }
        public CourierAnnouncerImpl(
            IThreadingProxy threadingProxy,
            ManageableCourierEndpoint localEndpoint,
            OutboundEnvelopeManager outboundEnvelopeManager)
        {
            this.threadingProxy          = threadingProxy;
            this.localEndpoint           = localEndpoint;
            this.outboundEnvelopeManager = outboundEnvelopeManager;

            this.thread = threadingProxy.CreateThread(ThreadStart, new ThreadCreationOptions()
            {
                IsBackground = true
            });
            this.cancellationTokenSource = threadingProxy.CreateCancellationTokenSource();
        }
Beispiel #6
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);
        }