|
|
|
@ -1478,10 +1478,12 @@ grpc_server* grpc_server_create(const grpc_channel_args* args, void* reserved) { |
|
|
|
|
GRPC_API_TRACE("grpc_server_create(%p, %p)", 2, (args, reserved)); |
|
|
|
|
grpc_channel_args* new_args = |
|
|
|
|
grpc_core::EnsureResourceQuotaInChannelArgs(args); |
|
|
|
|
grpc_core::Server* server = new grpc_core::Server(new_args); |
|
|
|
|
grpc_server* c_server = new grpc_server; |
|
|
|
|
c_server->core_server = |
|
|
|
|
grpc_core::MakeOrphanable<grpc_core::Server>(new_args); |
|
|
|
|
grpc_channel_args_destroy(new_args); |
|
|
|
|
grpc_channel_args_destroy(args); |
|
|
|
|
return server->c_ptr(); |
|
|
|
|
return c_server; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void grpc_server_register_completion_queue(grpc_server* server, |
|
|
|
@ -1500,7 +1502,7 @@ void grpc_server_register_completion_queue(grpc_server* server, |
|
|
|
|
/* Ideally we should log an error and abort but ruby-wrapped-language API
|
|
|
|
|
calls grpc_completion_queue_pluck() on server completion queues */ |
|
|
|
|
} |
|
|
|
|
grpc_core::Server::FromC(server)->RegisterCompletionQueue(cq); |
|
|
|
|
server->core_server->RegisterCompletionQueue(cq); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void* grpc_server_register_method( |
|
|
|
@ -1511,14 +1513,14 @@ void* grpc_server_register_method( |
|
|
|
|
"grpc_server_register_method(server=%p, method=%s, host=%s, " |
|
|
|
|
"flags=0x%08x)", |
|
|
|
|
4, (server, method, host, flags)); |
|
|
|
|
return grpc_core::Server::FromC(server)->RegisterMethod( |
|
|
|
|
method, host, payload_handling, flags); |
|
|
|
|
return server->core_server->RegisterMethod(method, host, payload_handling, |
|
|
|
|
flags); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void grpc_server_start(grpc_server* server) { |
|
|
|
|
grpc_core::ExecCtx exec_ctx; |
|
|
|
|
GRPC_API_TRACE("grpc_server_start(server=%p)", 1, (server)); |
|
|
|
|
grpc_core::Server::FromC(server)->Start(); |
|
|
|
|
server->core_server->Start(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void grpc_server_shutdown_and_notify(grpc_server* server, |
|
|
|
@ -1527,21 +1529,21 @@ void grpc_server_shutdown_and_notify(grpc_server* server, |
|
|
|
|
grpc_core::ExecCtx exec_ctx; |
|
|
|
|
GRPC_API_TRACE("grpc_server_shutdown_and_notify(server=%p, cq=%p, tag=%p)", 3, |
|
|
|
|
(server, cq, tag)); |
|
|
|
|
grpc_core::Server::FromC(server)->ShutdownAndNotify(cq, tag); |
|
|
|
|
server->core_server->ShutdownAndNotify(cq, tag); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void grpc_server_cancel_all_calls(grpc_server* server) { |
|
|
|
|
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; |
|
|
|
|
grpc_core::ExecCtx exec_ctx; |
|
|
|
|
GRPC_API_TRACE("grpc_server_cancel_all_calls(server=%p)", 1, (server)); |
|
|
|
|
grpc_core::Server::FromC(server)->CancelAllCalls(); |
|
|
|
|
server->core_server->CancelAllCalls(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void grpc_server_destroy(grpc_server* server) { |
|
|
|
|
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; |
|
|
|
|
grpc_core::ExecCtx exec_ctx; |
|
|
|
|
GRPC_API_TRACE("grpc_server_destroy(server=%p)", 1, (server)); |
|
|
|
|
grpc_core::Server::FromC(server)->Orphan(); |
|
|
|
|
delete server; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
grpc_call_error grpc_server_request_call( |
|
|
|
@ -1559,8 +1561,8 @@ grpc_call_error grpc_server_request_call( |
|
|
|
|
7, |
|
|
|
|
(server, call, details, request_metadata, cq_bound_to_call, |
|
|
|
|
cq_for_notification, tag)); |
|
|
|
|
return grpc_core::Server::FromC(server)->RequestCall( |
|
|
|
|
call, details, request_metadata, cq_bound_to_call, cq_for_notification, |
|
|
|
|
return server->core_server->RequestCall(call, details, request_metadata, |
|
|
|
|
cq_bound_to_call, cq_for_notification, |
|
|
|
|
tag); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1584,7 +1586,7 @@ grpc_call_error grpc_server_request_registered_call( |
|
|
|
|
9, |
|
|
|
|
(server, registered_method, call, deadline, request_metadata, |
|
|
|
|
optional_payload, cq_bound_to_call, cq_for_notification, tag_new)); |
|
|
|
|
return grpc_core::Server::FromC(server)->RequestRegisteredCall( |
|
|
|
|
return server->core_server->RequestRegisteredCall( |
|
|
|
|
rm, call, deadline, request_metadata, optional_payload, cq_bound_to_call, |
|
|
|
|
cq_for_notification, tag_new); |
|
|
|
|
} |
|
|
|
@ -1595,7 +1597,7 @@ void grpc_server_set_config_fetcher( |
|
|
|
|
grpc_core::ExecCtx exec_ctx; |
|
|
|
|
GRPC_API_TRACE("grpc_server_set_config_fetcher(server=%p, config_fetcher=%p)", |
|
|
|
|
2, (server, server_config_fetcher)); |
|
|
|
|
grpc_core::Server::FromC(server)->set_config_fetcher( |
|
|
|
|
server->core_server->set_config_fetcher( |
|
|
|
|
std::unique_ptr<grpc_server_config_fetcher>(server_config_fetcher)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|