Example #1
0
        public ActorConnectorChannel(
            ActorIdentity localActor,
            ActorTransportConnector remoteConnector,
            ActorChannelConfiguration channelConfiguration)
        {
            if (localActor == null)
            {
                throw new ArgumentNullException("localActor");
            }
            if (remoteConnector == null)
            {
                throw new ArgumentNullException("remoteConnector");
            }
            if (channelConfiguration == null)
            {
                throw new ArgumentNullException("channelConfiguration");
            }

            _localActor           = localActor;
            _connector            = remoteConnector;
            _channelConfiguration = channelConfiguration;

            _keepAliveTracker      = KeepAliveTracker.Create(KeepAliveInterval, new TimerCallback((s) => OnKeepAlive()));
            _keepAliveTimeoutTimer = new Timer(new TimerCallback((s) => OnKeepAliveTimeout()), null, Timeout.Infinite, Timeout.Infinite);
        }
        public ActorChannelSession(
            ActorIdentity localActor,
            ActorChannelConfiguration channelConfiguration,
            ActorTransportSession session)
        {
            _localActor           = localActor;
            _channelConfiguration = channelConfiguration;
            _innerSession         = session;

            _keepAliveTracker      = KeepAliveTracker.Create(KeepAliveInterval, new TimerCallback((s) => OnKeepAlive()));
            _keepAliveTimeoutTimer = new Timer(new TimerCallback((s) => OnKeepAliveTimeout()), null, Timeout.Infinite, Timeout.Infinite);
        }