Example #1
0
        /// <summary>
        ///     Creates a new DarkRiftClient object with specified cache settings.
        /// </summary>
        /// <param name="objectCacheSettings">The settings for the object cache.</param>
        public DarkRiftClient(ClientObjectCacheSettings objectCacheSettings)
        {
            ObjectCache.Initialize(objectCacheSettings);
            ClientObjectCache.Initialize(objectCacheSettings);

            this.RoundTripTime = new RoundTripTimeHelper(10, 10);
        }
Example #2
0
        public DarkRiftClient(int maxCachedWriters = 2, int maxCachedReaders = 2, int maxCachedMessages = 4, int maxCachedSocketAsyncEventArgs = 32, int maxActionDispatcherTasks = 16)
        {
            ObjectCacheSettings objectCacheSettings = DefaultCacheSettings;

            objectCacheSettings.MaxWriters               = maxCachedWriters;
            objectCacheSettings.MaxReaders               = maxCachedReaders;
            objectCacheSettings.MaxMessages              = maxCachedMessages;
            objectCacheSettings.MaxSocketAsyncEventArgs  = maxCachedSocketAsyncEventArgs;
            objectCacheSettings.MaxActionDispatcherTasks = maxActionDispatcherTasks;

            ObjectCache.Initialize(objectCacheSettings);

            this.RoundTripTime = new RoundTripTimeHelper(10, 10);
        }
Example #3
0
        public DarkRiftClient(ObjectCacheSettings objectCacheSettings)
        {
            ObjectCache.Initialize(objectCacheSettings);

            if (objectCacheSettings is ClientObjectCacheSettings settings)
            {
                ClientObjectCache.Initialize(settings);
            }
            else
            {
                ClientObjectCacheSettings clientObjectCacheSettings = new ClientObjectCacheSettings {
                    MaxMessageReceivedEventArgs = 4
                };
                ClientObjectCache.Initialize(clientObjectCacheSettings);
            }

            this.RoundTripTime = new RoundTripTimeHelper(10, 10);
        }
Example #4
0
 public RoundTripTimeHelperTests()
 {
     roundTripTime = new RoundTripTimeHelper(2, 3);
 }