add function fc_server_get_group_by_index

support_rdma
YuQing 2023-09-07 09:34:45 +08:00
parent 44f827f291
commit bc3a65ee19
2 changed files with 12 additions and 1 deletions

View File

@ -42,7 +42,8 @@ extern "C" {
typedef enum {
fc_comm_type_sock = 0,
fc_comm_type_rdma
fc_comm_type_rdma,
fc_comm_type_both
} FCCommunicationType;
typedef struct {

View File

@ -141,6 +141,16 @@ static inline FCServerInfo *fc_server_get_by_ip_port(FCServerConfig *ctx,
FCServerGroupInfo *fc_server_get_group_by_name(FCServerConfig *ctx,
const string_t *group_name);
static inline FCServerGroupInfo *fc_server_get_group_by_index(
FCServerConfig *ctx, const int index)
{
if (index < 0 || index >= ctx->group_array.count) {
return NULL;
}
return ctx->group_array.groups + index;
}
static inline int fc_server_get_group_index_ex(FCServerConfig *ctx,
const string_t *group_name)
{