diff --git a/src/Nacos/Remote/GRpc/GrpcClient.cs b/src/Nacos/Remote/GRpc/GrpcClient.cs index b1b3396..fe9905a 100644 --- a/src/Nacos/Remote/GRpc/GrpcClient.cs +++ b/src/Nacos/Remote/GRpc/GrpcClient.cs @@ -150,6 +150,12 @@ private CommonResponse ServerCheck(Grpc.Net.Client.GrpcChannel channel) { try { + if (request is SetupAckRequest) + { + // there is no connection ready this time + return; + } + var response = HandleServerRequest(request); response.RequestId = request.RequestId; await call.RequestStream.WriteAsync(GrpcUtils.Convert(response)).ConfigureAwait(false); diff --git a/src/Nacos/Remote/RemoteRequestType.cs b/src/Nacos/Remote/RemoteRequestType.cs index 38f3788..11d4a2c 100644 --- a/src/Nacos/Remote/RemoteRequestType.cs +++ b/src/Nacos/Remote/RemoteRequestType.cs @@ -36,6 +36,8 @@ public static class RemoteRequestType public static readonly string Req_ServerCheck = "ServerCheckRequest"; + public static readonly string Req_SetupAck = "SetupAckRequest"; + public static readonly string Req_Config_ReSync = "ConfigReSyncRequest"; public static readonly string Resp_Config_Pubish_Alpha2 = "ConfigPublishResponse"; @@ -68,6 +70,8 @@ public static class RemoteRequestType public static readonly string Resp_ServerCheck = "ServerCheckResponse"; + public static readonly string Resp_SetupAck = "SetupAckResponse"; + public static readonly string Req_PushAck = "PushAckRequest"; public static readonly string Req_ConnectReset = "ConnectResetRequest"; @@ -113,6 +117,8 @@ public static class RemoteRequestType { Resp_Naming_NotifySubscriber, typeof(NotifySubscriberResponse) }, { Req_Naming_BatchInstance, typeof(BatchInstanceRequest) }, { Resp_Naming_BatchInstance, typeof(BatchInstanceResponse) }, + { Req_SetupAck, typeof(SetupAckRequest) }, + { Resp_SetupAck, typeof(SetupAckResponse) }, }; } } diff --git a/src/Nacos/Remote/Requests/SetupAckRequest.cs b/src/Nacos/Remote/Requests/SetupAckRequest.cs new file mode 100644 index 0000000..94e3287 --- /dev/null +++ b/src/Nacos/Remote/Requests/SetupAckRequest.cs @@ -0,0 +1,11 @@ +namespace Nacos.Remote.Requests +{ + using System.Collections.Generic; + + public class SetupAckRequest : CommonRequest + { + public Dictionary AbilityTable { get; set; } + + public override string GetRemoteType() => RemoteRequestType.Req_SetupAck; + } +} diff --git a/src/Nacos/Remote/Responses/SetupAckResponse.cs b/src/Nacos/Remote/Responses/SetupAckResponse.cs new file mode 100644 index 0000000..8c85af2 --- /dev/null +++ b/src/Nacos/Remote/Responses/SetupAckResponse.cs @@ -0,0 +1,7 @@ +namespace Nacos.Remote.Responses +{ + public class SetupAckResponse : CommonResponse + { + public override string GetRemoteType() => RemoteRequestType.Resp_SetupAck; + } +}