#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <inttypes.h>
#include <io.h>
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/pollset_windows.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/tcp_windows.h"
grpc_closure* shutdown_complete;
grpc_channel_args* channel_args;
+ grpc_slice_allocator_factory* slice_allocator_factory;
};
/* Public function. Allocates the proper data structures to hold a
grpc_tcp_server. */
-static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server) {
+static grpc_error_handle tcp_server_create(
+ grpc_closure* shutdown_complete, const grpc_channel_args* args,
+ grpc_slice_allocator_factory* slice_allocator_factory,
+ grpc_tcp_server** server) {
grpc_tcp_server* s = (grpc_tcp_server*)gpr_malloc(sizeof(grpc_tcp_server));
s->channel_args = grpc_channel_args_copy(args);
gpr_ref_init(&s->refs, 1);
s->shutdown_starting.head = NULL;
s->shutdown_starting.tail = NULL;
s->shutdown_complete = shutdown_complete;
+ s->slice_allocator_factory = slice_allocator_factory;
*server = s;
return GRPC_ERROR_NONE;
}
static void tcp_server_destroy(grpc_tcp_server* s) {
grpc_tcp_listener* sp;
gpr_mu_lock(&s->mu);
-
+ grpc_slice_allocator_factory_destroy(s->slice_allocator_factory);
/* First, shutdown all fd's. This will queue abortion calls for all
of the pending accepts due to the normal operation mechanism. */
if (s->active_ports == 0) {
gpr_mu_unlock(&sp->server->mu);
return;
}
-
/* The IOCP notified us of a completed operation. Let's grab the results,
and act accordingly. */
transfered_bytes = 0;
gpr_free(utf8_message);
}
std::string fd_name = absl::StrCat("tcp_server:", peer_name_string);
- ep = grpc_tcp_create(grpc_winsocket_create(sock, fd_name.c_str()),
- sp->server->channel_args, peer_name_string.c_str());
+ ep = grpc_tcp_create(
+ grpc_winsocket_create(sock, fd_name.c_str()),
+ sp->server->channel_args, peer_name_string.c_str(),
+ grpc_slice_allocator_factory_create_slice_allocator(
+ sp->server->slice_allocator_factory, peer_name_string));
} else {
closesocket(sock);
}