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; }
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(); }
internal void ReRegisterGeneralNotification(Connection connection) { RegisterNodeJoinedEvent(connection); RegisterNodeLeftEvent(connection); }
/// <summary> /// Will be called by broker incase of multiple connection /// </summary> /// <param name="connection"></param> internal void RegisterNodeLeftEvent(Connection connection) { RegisterNotifications(NotificationsType.RegNodeLeftNotif, connection); }
/// <summary> /// Will be called by broker incase of multiple connection /// </summary> /// <param name="connection"></param> internal void RegisterNodeJoinedEvent(Connection connection) { RegisterNotifications(NotificationsType.RegNodeJoinedNotif, connection); }
internal void RegisterHashmapChangedEvent(Connection connection) { RegisterNotifications(NotificationsType.RegHashmapChangedNotif, connection); }
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; }
/// <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; }