예제 #1
0
 internal SocketManager(IMessagingConfiguration config, ILoggerFactory loggerFactory)
 {
     connectionTimeout      = config.OpenConnectionTimeout;
     cache                  = new LRU <IPEndPoint, Socket>(MAX_SOCKETS, config.MaxSocketAge, SendingSocketCreator);
     this.logger            = loggerFactory.CreateLogger <SocketManager>();
     cache.RaiseFlushEvent += FlushHandler;
 }
예제 #2
0
        internal SocketManager(IOptions <MessagingOptions> options, ILoggerFactory loggerFactory)
        {
            var messagingOptions = options.Value;

            connectionTimeout      = messagingOptions.OpenConnectionTimeout;
            cache                  = new LRU <IPEndPoint, Socket>(MAX_SOCKETS, messagingOptions.MaxSocketAge, SendingSocketCreator);
            this.logger            = loggerFactory.CreateLogger <SocketManager>();
            cache.RaiseFlushEvent += FlushHandler;
        }
예제 #3
0
        private static void FlushHandler(Object sender, LRU <IPEndPoint, Socket> .FlushEventArgs args)
        {
            if (args.Value == null)
            {
                return;
            }

            CloseSocket(args.Value);
            NetworkingStatisticsGroup.OnClosedSendingSocket();
        }
예제 #4
0
파일: LRU.cs 프로젝트: pipermatt/orleans
 public TimestampedValue(LRU <TKey, TValue> l, TValue v)
 {
     Generation = Interlocked.Increment(ref l.nextGeneration);
     Value      = v;
     Age        = CoarseStopwatch.StartNew();
 }
예제 #5
0
 internal SocketManager(IMessagingConfiguration config)
 {
     cache = new LRU <IPEndPoint, Socket>(MAX_SOCKETS, config.MaxSocketAge, SendingSocketCreator);
     cache.RaiseFlushEvent += FlushHandler;
 }
예제 #6
0
 public TimestampedValue(LRU <TKey, TValue> l, TValue v)
 {
     Generation = Interlocked.Increment(ref l.nextGeneration);
     Value      = v;
     WhenLoaded = DateTime.UtcNow;
 }
예제 #7
0
파일: LRU.cs 프로젝트: dotnet/orleans
 public TimestampedValue(LRU <TKey, TValue> l, TValue v, long generation)
 {
     Generation = generation;
     Value      = v;
     Age        = CoarseStopwatch.StartNew();
 }