コード例 #1
0
 public IResponse VisitClientHandShakeRequest(ClientHandShakeRequest clientHandShakeRequest)
 {
     Uri[] viewConfiguration = this.replicaState.Configuration.Values.ToArray();
     return(new ClientHandShakeResponse(
                Protocol.StateMachineReplication,
                this.replicaState.ViewNumber,
                viewConfiguration,
                this.replicaState.Configuration[this.replicaState.Leader]));
 }
        public IMessage ParseData(byte[] data)
        {
            String message = Encoding.UTF8.GetString(data);

            if (Regex.IsMatch(message, "^GET"))
            {
                try
                {
                    var headers = HttpParser.GetHeaders(message);
                    ClientHandShakeRequest request = new ClientHandShakeRequest(headers);
                    request.InitRequest();

                    return(request);
                }
                catch (FormatException ex)
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
 public IResponse VisitClientHandShakeRequest(ClientHandShakeRequest clientHandShakeRequest)
 {
     return(this.WaitNormalState(clientHandShakeRequest));
 }
コード例 #4
0
 public IResponse VisitClientHandShakeRequest(ClientHandShakeRequest clientHandShakeRequest)
 {
     Uri[] viewConfiguration = this.replicaState.Configuration.Values.ToArray();
     return(new ClientHandShakeResponse(Protocol.XuLiskov, this.replicaState.ViewNumber, viewConfiguration));
 }