aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/udp_server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/iomgr/udp_server.cc')
-rw-r--r--src/core/lib/iomgr/udp_server.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/udp_server.cc b/src/core/lib/iomgr/udp_server.cc
index 99af977da3..bdb2d0e764 100644
--- a/src/core/lib/iomgr/udp_server.cc
+++ b/src/core/lib/iomgr/udp_server.cc
@@ -197,8 +197,14 @@ struct grpc_udp_server {
};
static grpc_socket_factory* get_socket_factory(const grpc_channel_args* args) {
- return grpc_channel_args_get_pointer<grpc_socket_factory>(
- args, GRPC_ARG_SOCKET_FACTORY);
+ if (args) {
+ const grpc_arg* arg = grpc_channel_args_find(args, GRPC_ARG_SOCKET_FACTORY);
+ if (arg) {
+ GPR_ASSERT(arg->type == GRPC_ARG_POINTER);
+ return static_cast<grpc_socket_factory*>(arg->value.pointer.p);
+ }
+ }
+ return nullptr;
}
grpc_udp_server* grpc_udp_server_create(const grpc_channel_args* args) {