|
|
|
@ -176,7 +176,10 @@ static void read_test(size_t num_bytes, size_t slice_size) { |
|
|
|
|
|
|
|
|
|
create_sockets(sv); |
|
|
|
|
|
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), slice_size, "test"); |
|
|
|
|
grpc_buffer_pool *buffer_pool = grpc_buffer_pool_create(); |
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), buffer_pool, |
|
|
|
|
slice_size, "test"); |
|
|
|
|
grpc_buffer_pool_internal_unref(&exec_ctx, buffer_pool); |
|
|
|
|
grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); |
|
|
|
|
|
|
|
|
|
written_bytes = fill_socket_partial(sv[0], num_bytes); |
|
|
|
@ -223,8 +226,10 @@ static void large_read_test(size_t slice_size) { |
|
|
|
|
|
|
|
|
|
create_sockets(sv); |
|
|
|
|
|
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test"), slice_size, |
|
|
|
|
"test"); |
|
|
|
|
grpc_buffer_pool *buffer_pool = grpc_buffer_pool_create(); |
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test"), buffer_pool, |
|
|
|
|
slice_size, "test"); |
|
|
|
|
grpc_buffer_pool_internal_unref(&exec_ctx, buffer_pool); |
|
|
|
|
grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); |
|
|
|
|
|
|
|
|
|
written_bytes = fill_socket(sv[0]); |
|
|
|
@ -359,8 +364,10 @@ static void write_test(size_t num_bytes, size_t slice_size) { |
|
|
|
|
|
|
|
|
|
create_sockets(sv); |
|
|
|
|
|
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test"), |
|
|
|
|
grpc_buffer_pool *buffer_pool = grpc_buffer_pool_create(); |
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test"), buffer_pool, |
|
|
|
|
GRPC_TCP_DEFAULT_READ_SLICE_SIZE, "test"); |
|
|
|
|
grpc_buffer_pool_internal_unref(&exec_ctx, buffer_pool); |
|
|
|
|
grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); |
|
|
|
|
|
|
|
|
|
state.ep = ep; |
|
|
|
@ -423,8 +430,11 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { |
|
|
|
|
|
|
|
|
|
create_sockets(sv); |
|
|
|
|
|
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), slice_size, "test"); |
|
|
|
|
grpc_buffer_pool *buffer_pool = grpc_buffer_pool_create(); |
|
|
|
|
ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), buffer_pool, |
|
|
|
|
slice_size, "test"); |
|
|
|
|
GPR_ASSERT(grpc_tcp_fd(ep) == sv[1] && sv[1] >= 0); |
|
|
|
|
grpc_buffer_pool_internal_unref(&exec_ctx, buffer_pool); |
|
|
|
|
grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); |
|
|
|
|
|
|
|
|
|
written_bytes = fill_socket_partial(sv[0], num_bytes); |
|
|
|
@ -506,10 +516,12 @@ static grpc_endpoint_test_fixture create_fixture_tcp_socketpair( |
|
|
|
|
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |
|
|
|
|
|
|
|
|
|
create_sockets(sv); |
|
|
|
|
grpc_buffer_pool *buffer_pool = grpc_buffer_pool_create(); |
|
|
|
|
f.client_ep = grpc_tcp_create(grpc_fd_create(sv[0], "fixture:client"), |
|
|
|
|
slice_size, "test"); |
|
|
|
|
buffer_pool, slice_size, "test"); |
|
|
|
|
f.server_ep = grpc_tcp_create(grpc_fd_create(sv[1], "fixture:server"), |
|
|
|
|
slice_size, "test"); |
|
|
|
|
buffer_pool, slice_size, "test"); |
|
|
|
|
grpc_buffer_pool_internal_unref(&exec_ctx, buffer_pool); |
|
|
|
|
grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset); |
|
|
|
|
grpc_endpoint_add_to_pollset(&exec_ctx, f.server_ep, g_pollset); |
|
|
|
|
|
|
|
|
|