tcp_client_posix.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H
20 #define GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H
21 
23 
27 
28 /* Create an endpoint from a connected grpc_fd.
29 
30  fd: a connected FD. Ownership is taken.
31  channel_args: may contain custom settings for the endpoint
32  addr_str: destination address in printable format
33  slice_allocator: ownership is taken by client.
34  Returns: a new endpoint
35 */
37  grpc_fd* fd, const grpc_channel_args* channel_args,
38  absl::string_view addr_str);
39 
40 /* Return a configured, unbound, unconnected TCP client fd.
41 
42  channel_args: may contain custom settings for the fd
43  addr: the destination address
44  mapped_addr: out parameter. addr mapped to an address appropriate to the
45  type of socket FD created. For example, if addr is IPv4 and dual stack
46  sockets are available, mapped_addr will be an IPv4-mapped IPv6 address
47  fd: out parameter. The new FD
48  Returns: error, if any. Out parameters are not set on error
49 */
51  const grpc_channel_args* channel_args, const grpc_resolved_address* addr,
52  grpc_resolved_address* mapped_addr, int* fd);
53 
54 /* Connect a configured TCP client fd.
55 
56  interested_parties: a set of pollsets that would be interested in this
57  connection being established (in order to continue their work
58  closure: called when complete. On success, *ep will be set.
59  fd: an FD returned from grpc_tcp_client_prepare_fd().
60  channel_args: may contain custom settings for the endpoint
61  deadline: connection deadline
62  ep: out parameter. Set before closure is called if successful
63 */
65  grpc_pollset_set* interested_parties, grpc_closure* closure, const int fd,
66  const grpc_channel_args* channel_args, const grpc_resolved_address* addr,
67  grpc_core::Timestamp deadline, grpc_endpoint** ep);
68 
69 #endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */
grpc_pollset_set
struct grpc_pollset_set grpc_pollset_set
Definition: iomgr_fwd.h:23
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
grpc_resolved_address
Definition: resolved_address.h:34
grpc_channel_args
Definition: grpc_types.h:132
grpc_tcp_client_create_from_fd
grpc_endpoint * grpc_tcp_client_create_from_fd(grpc_fd *fd, const grpc_channel_args *channel_args, absl::string_view addr_str)
grpc_tcp_client_create_from_prepared_fd
int64_t grpc_tcp_client_create_from_prepared_fd(grpc_pollset_set *interested_parties, grpc_closure *closure, const int fd, const grpc_channel_args *channel_args, const grpc_resolved_address *addr, grpc_core::Timestamp deadline, grpc_endpoint **ep)
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
ev_posix.h
grpc_fd
struct grpc_fd grpc_fd
Definition: ev_posix.h:44
tcp_client.h
grpc_tcp_client_prepare_fd
grpc_error_handle grpc_tcp_client_prepare_fd(const grpc_channel_args *channel_args, const grpc_resolved_address *addr, grpc_resolved_address *mapped_addr, int *fd)
closure
Definition: proxy.cc:59
endpoint.h
grpc_error
Definition: error_internal.h:42
grpc_closure
Definition: closure.h:56
grpc_endpoint
Definition: endpoint.h:105
addr
struct sockaddr_in addr
Definition: libuv/docs/code/tcp-echo-server/main.c:10
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:29