Skip to content

Commit

Permalink
add SetupAckRequest
Browse files Browse the repository at this point in the history
Signed-off-by: catcherwong <[email protected]>
  • Loading branch information
catcherwong committed Nov 11, 2023
1 parent fe69b6d commit b44011e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Nacos/Remote/GRpc/GrpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions src/Nacos/Remote/RemoteRequestType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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) },
};
}
}
11 changes: 11 additions & 0 deletions src/Nacos/Remote/Requests/SetupAckRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Nacos.Remote.Requests
{
using System.Collections.Generic;

public class SetupAckRequest : CommonRequest
{
public Dictionary<string, bool> AbilityTable { get; set; }

public override string GetRemoteType() => RemoteRequestType.Req_SetupAck;
}
}
7 changes: 7 additions & 0 deletions src/Nacos/Remote/Responses/SetupAckResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Nacos.Remote.Responses
{
public class SetupAckResponse : CommonResponse
{
public override string GetRemoteType() => RemoteRequestType.Resp_SetupAck;
}
}

0 comments on commit b44011e

Please sign in to comment.