Пример #1
0
        public void Process()
        {
            ClientManager clientManager = null;

            lock (ConnectionManager.ConnectionTable) clientManager = (ClientManager)ConnectionManager.ConnectionTable[_clientId];
            if (clientManager != null)
            {
                Alachisoft.NCache.Common.Protobuf.Response response = new Alachisoft.NCache.Common.Protobuf.Response();
                Alachisoft.NCache.Common.Protobuf.NodeLeftEventResponse nodeLeft = new Alachisoft.NCache.Common.Protobuf.NodeLeftEventResponse();

                nodeLeft.clusterIp   = _clusterAddress.IpAddress.ToString();
                nodeLeft.clusterPort = _clusterAddress.Port.ToString();
                nodeLeft.serverIp    = _serverAddress.IpAddress.ToString();
                nodeLeft.serverPort  = _serverAddress.Port.ToString();

                response.nodeLeft     = nodeLeft;
                response.responseType = Alachisoft.NCache.Common.Protobuf.Response.Type.NODE_LEFT_EVENT;

                IList serializedResponse = Alachisoft.NCache.Common.Util.ResponseHelper.SerializeResponse(response, Common.Protobuf.Response.Type.NODE_LEFT_EVENT);

                ConnectionManager.AssureSend(clientManager, serializedResponse, false);
            }
        }
Пример #2
0
        public void Process()
        {
            ClientManager clientManager = null;

            lock (ConnectionManager.ConnectionTable) clientManager = (ClientManager)ConnectionManager.ConnectionTable[_clientId];
            if (clientManager != null)
            {
                Alachisoft.NCache.Common.Protobuf.Response response = new Alachisoft.NCache.Common.Protobuf.Response();
                Alachisoft.NCache.Common.Protobuf.NodeLeftEventResponse nodeLeft = new Alachisoft.NCache.Common.Protobuf.NodeLeftEventResponse();

                nodeLeft.clusterIp = _clusterAddress.IpAddress.ToString();
                nodeLeft.clusterPort = _clusterAddress.Port.ToString();
                nodeLeft.serverIp = _serverAddress.IpAddress.ToString();
                nodeLeft.serverPort = _serverAddress.Port.ToString();

                response.nodeLeft = nodeLeft;
                response.responseType = Alachisoft.NCache.Common.Protobuf.Response.Type.NODE_LEFT_EVENT;

                byte[] serializedResponse = Alachisoft.NCache.Common.Util.ResponseHelper.SerializeResponse(response);

                ConnectionManager.AssureSend(clientManager, serializedResponse, Alachisoft.NCache.Common.Enum.Priority.Critical);
            }
        }