예제 #1
0
        internal ClientConductor(Aeron.Context ctx)
        {
            _ctx = ctx;

            _clientLock                     = ctx.ClientLock();
            _epochClock                     = ctx.EpochClock();
            _nanoClock                      = ctx.NanoClock();
            _errorHandler                   = ctx.ErrorHandler();
            _counterValuesBuffer            = ctx.CountersValuesBuffer();
            _driverProxy                    = ctx.DriverProxy();
            _logBuffersFactory              = ctx.LogBuffersFactory();
            _imageMapMode                   = ctx.ImageMapMode();
            _keepAliveIntervalNs            = ctx.KeepAliveInterval();
            _driverTimeoutMs                = ctx.DriverTimeoutMs();
            _driverTimeoutNs                = _driverTimeoutMs * 1000000;
            _interServiceTimeoutNs          = ctx.InterServiceTimeout();
            _publicationConnectionTimeoutMs = ctx.PublicationConnectionTimeout();
            _driverListener                 = new DriverListenerAdapter(ctx.ToClientBuffer(), this);
            _driverAgentInvoker             = ctx.DriverAgentInvoker();

            long nowNs = _nanoClock.NanoTime();

            _timeOfLastKeepaliveNs      = nowNs;
            _timeOfLastCheckResourcesNs = nowNs;
            _timeOfLastWorkNs           = nowNs;
        }
예제 #2
0
        internal ClientConductor(Aeron.Context ctx)
        {
            _clientLock                     = ctx.ClientLock();
            _epochClock                     = ctx.EpochClock();
            _nanoClock                      = ctx.NanoClock();
            _errorHandler                   = ctx.ErrorHandler();
            _counterValuesBuffer            = ctx.CountersValuesBuffer();
            _driverProxy                    = ctx.DriverProxy();
            _logBuffersFactory              = ctx.LogBuffersFactory();
            _imageMapMode                   = ctx.ImageMapMode();
            _keepAliveIntervalNs            = ctx.KeepAliveInterval();
            _driverTimeoutMs                = ctx.DriverTimeoutMs();
            _driverTimeoutNs                = _driverTimeoutMs * 1000000;
            _interServiceTimeoutNs          = ctx.InterServiceTimeout();
            _publicationConnectionTimeoutMs = ctx.PublicationConnectionTimeout();
            _defaultAvailableImageHandler   = ctx.AvailableImageHandler();
            _defaultUnavailableImageHandler = ctx.UnavailableImageHandler();
            _driverEventsAdapter            = new DriverEventsAdapter(ctx.ToClientBuffer(), this);

            long nowNs = _nanoClock.NanoTime();

            _timeOfLastKeepAliveNs      = nowNs;
            _timeOfLastResourcesCheckNs = nowNs;
            _timeOfLastServiceNs        = nowNs;
        }