Fix udp server

pull/9207/head
Craig Tiller 8 years ago
parent eff97ae57a
commit ff281b9d22
  1. 8
      src/core/lib/iomgr/udp_server.c

@ -170,8 +170,8 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) {
for (sp = s->head; sp; sp = sp->next) { for (sp = s->head; sp; sp = sp->next) {
grpc_unlink_if_unix_domain_socket(&sp->addr); grpc_unlink_if_unix_domain_socket(&sp->addr);
sp->destroyed_closure.cb = destroyed_port; grpc_closure_init(&sp->destroyed_closure, destroyed_port, s,
sp->destroyed_closure.cb_arg = s; grpc_schedule_on_exec_ctx);
/* Call the orphan_cb to signal that the FD is about to be closed and /* Call the orphan_cb to signal that the FD is about to be closed and
* should no longer be used. */ * should no longer be used. */
@ -446,8 +446,8 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
for (i = 0; i < pollset_count; i++) { for (i = 0; i < pollset_count; i++) {
grpc_pollset_add_fd(exec_ctx, pollsets[i], sp->emfd); grpc_pollset_add_fd(exec_ctx, pollsets[i], sp->emfd);
} }
sp->read_closure.cb = on_read; grpc_closure_init(&sp->read_closure, on_read, sp,
sp->read_closure.cb_arg = sp; grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_read(exec_ctx, sp->emfd, &sp->read_closure); grpc_fd_notify_on_read(exec_ctx, sp->emfd, &sp->read_closure);
s->active_ports++; s->active_ports++;

Loading…
Cancel
Save