aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/udp_server.c
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-10-07 14:26:37 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-10-07 14:26:37 -0700
commit90576b1b67f48a1581f6cf36626118e5035d16d1 (patch)
treeedbb2878a1baee506a1ce0d21dd57bd17fb06a6a /src/core/lib/iomgr/udp_server.c
parent43b817ced14083de585111c2657bbe34040bdcc7 (diff)
parent70c0b32c0fc5db15c764a2e22c2491d19d7cff7b (diff)
Merge remote-tracking branch 'upstream/master' into run_interop_tests_go
Diffstat (limited to 'src/core/lib/iomgr/udp_server.c')
-rw-r--r--src/core/lib/iomgr/udp_server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c
index 48032412a2..edf7b133e9 100644
--- a/src/core/lib/iomgr/udp_server.c
+++ b/src/core/lib/iomgr/udp_server.c
@@ -38,7 +38,6 @@
#include <grpc/support/port_platform.h>
-#ifdef GRPC_NEED_UDP
#ifdef GPR_POSIX_SOCKET
#include "src/core/lib/iomgr/udp_server.h"
@@ -171,6 +170,8 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) {
sp->destroyed_closure.cb = destroyed_port;
sp->destroyed_closure.cb_arg = s;
+ /* Call the orphan_cb to signal that the FD is about to be closed and
+ * should no longer be used. */
GPR_ASSERT(sp->orphan_cb);
sp->orphan_cb(sp->emfd);
@@ -197,6 +198,12 @@ void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
/* shutdown all fd's */
if (s->active_ports) {
for (i = 0; i < s->nports; i++) {
+ server_port *sp = &s->ports[i];
+ /* Call the orphan_cb to signal that the FD is about to be closed and
+ * should no longer be used. */
+ GPR_ASSERT(sp->orphan_cb);
+ sp->orphan_cb(sp->emfd);
+
grpc_fd_shutdown(exec_ctx, s->ports[i].emfd);
}
gpr_mu_unlock(&s->mu);
@@ -439,4 +446,3 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
}
#endif
-#endif