Пример #1
0
 internal NagglingManager(Connection parent, Socket workingSocket, Alachisoft.NCache.Common.DataStructures.Queue msgQueue, long nagglingSize, object syncLock)
 {
     _parent = parent;
     _workingSocket = workingSocket;
     _nagglingSize = nagglingSize;
     _msgQueue = msgQueue;
     _sendBuffer = new byte[_sendBufferSize];
     _syncLock = syncLock;
 }
Пример #2
0
        private void RegisterNotifications(NotificationsType notifMask, Connection connection)
        {
            RegisterNotificationCommand command = new RegisterNotificationCommand(notifMask,-1);

            Request request = new Request(false, _broker.OperationTimeOut);
            Address ipAddress = connection.ServerAddress;
            request.AddCommand(ipAddress, command);

            _broker.ExecuteRequest(request, connection, true, true);

            CommandResponse res = (CommandResponse)request.Response;
            res.ParseResponse();
        }
Пример #3
0
 internal void ReRegisterGeneralNotification(Connection connection)
 {
     RegisterNodeJoinedEvent(connection);
     RegisterNodeLeftEvent(connection);
 }
Пример #4
0
 /// <summary>
 /// Will be called by broker incase of multiple connection
 /// </summary>
 /// <param name="connection"></param>
 internal void RegisterNodeLeftEvent(Connection connection)
 {
     RegisterNotifications(NotificationsType.RegNodeLeftNotif, connection);
 }
Пример #5
0
 /// <summary>
 /// Will be called by broker incase of multiple connection
 /// </summary>
 /// <param name="connection"></param>
 internal void RegisterNodeJoinedEvent(Connection connection)
 {
     RegisterNotifications(NotificationsType.RegNodeJoinedNotif, connection);
 }
Пример #6
0
 internal void RegisterHashmapChangedEvent(Connection connection)
 {
     RegisterNotifications(NotificationsType.RegHashmapChangedNotif, connection);
 }
Пример #7
0
        internal void GetTypeInfoMap(Connection connection)
        {
            GetTypeInfoMapCommand command = new GetTypeInfoMapCommand(false);

            Request request = new Request(false, _broker.OperationTimeOut);
            Address ipAddress = connection.ServerAddress;
            request.AddCommand(ipAddress, command);
            _broker.ExecuteRequest(request, connection, true, true);
            CommandResponse res = request.Response;
            res.ParseResponse();

            this.TypeMap = res.TypeMap;
        }
Пример #8
0
 /// <summary>
 /// Add connection to pool. If connection already exists, it will be replaced with new
 /// connection instance
 /// </summary>
 /// <param name="ip">ip address of machine to which connection is made</param>
 /// <param name="connection">connection object</param>
 public void Add(Address ip, Connection connection)
 {
     lock (this._connections.SyncRoot) this._connections[ip] = connection;
 }