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); } }
public IResponse VisitClientHandShakeRequest(ClientHandShakeRequest clientHandShakeRequest) { return(this.WaitNormalState(clientHandShakeRequest)); }
public IResponse VisitClientHandShakeRequest(ClientHandShakeRequest clientHandShakeRequest) { Uri[] viewConfiguration = this.replicaState.Configuration.Values.ToArray(); return(new ClientHandShakeResponse(Protocol.XuLiskov, this.replicaState.ViewNumber, viewConfiguration)); }