/// <summary>Creates a new proxy</summary>
 /// <param name="clientRequestQueueFormatName">The queue to listen for subscribe and unsubscribe requests</param>
 /// <param name="multicastInputQueueFormatName">The queue contains the messages we want to subscribe to</param>
 public LabelSubscriptionServer(string clientRequestQueueFormatName, string multicastInputQueueFormatName)
 {
     Contract.Requires(clientRequestQueueFormatName != null);
     Contract.Requires(multicastInputQueueFormatName != null);
     ClientRequestQueueFormatName  = clientRequestQueueFormatName;
     MulticastInputQueueFormatName = multicastInputQueueFormatName;
     _subscriptions        = new FormatNameSubscriptions();
     _responseQueueCache   = new QueueCache <QueueWriter>((fn, mode, share) => new QueueWriter(fn));
     _adminQueueFormatName = Queues.TryCreate(Queues.NewTempQueuePath(), QueueTransactional.None);
 }
示例#2
0
        public MessageCache(string inputQueueFormatName, string adminQueueFormatName, int?cacheGen0Limit, TimeSpan?cacheTimeToLive, TimeSpan?replyTimeToLive = null)
        {
            Contract.Requires(!string.IsNullOrEmpty(inputQueueFormatName));
            Contract.Requires(!string.IsNullOrEmpty(adminQueueFormatName));
            if (Queues.IsTransactional(inputQueueFormatName) != QueueTransactional.None)
            {
                throw new ArgumentException(inputQueueFormatName + " must be non-transactional");
            }
            if (Queues.IsTransactional(adminQueueFormatName) != QueueTransactional.None)
            {
                throw new ArgumentException(adminQueueFormatName + " must be non-transactional");
            }

            InputQueueFormatName = inputQueueFormatName;
            AdminQueueFormatName = adminQueueFormatName;
            CacheGen0Limit       = cacheGen0Limit;
            CacheTimeToLive      = cacheTimeToLive;
            _queueCache          = new QueueCache <QueueWriter>((fn, mode, share) => new QueueWriter(fn));
        }