GRPC Core 0.10.0.0

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
connector.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright 2015, Google Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34 #ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_CONNECTOR_H
35 #define GRPC_INTERNAL_CORE_CLIENT_CONFIG_CONNECTOR_H
36
37 #include "src/core/channel/channel_stack.h"
38 #include "src/core/iomgr/sockaddr.h"
39 #include "src/core/transport/transport.h"
40
41 typedef struct grpc_connector grpc_connector;
42 typedef struct grpc_connector_vtable grpc_connector_vtable;
43
44 struct grpc_connector {
45 const grpc_connector_vtable *vtable;
46 };
47
48 typedef struct {
50 grpc_pollset_set *interested_parties;
52 const struct sockaddr *addr;
53 int addr_len;
55 gpr_timespec deadline;
57 const grpc_channel_args *channel_args;
59 grpc_mdctx *metadata_context;
60 } grpc_connect_in_args;
61
62 typedef struct {
64 grpc_transport *transport;
66 const grpc_channel_filter **filters;
67 size_t num_filters;
68 } grpc_connect_out_args;
69
70 struct grpc_connector_vtable {
71 void (*ref)(grpc_connector *connector);
72 void (*unref)(grpc_connector *connector);
73 void (*connect)(grpc_connector *connector,
74 const grpc_connect_in_args *in_args,
75 grpc_connect_out_args *out_args, grpc_iomgr_closure *notify);
76 };
77
78 void grpc_connector_ref(grpc_connector *connector);
79 void grpc_connector_unref(grpc_connector *connector);
80 void grpc_connector_connect(grpc_connector *connector,
81 const grpc_connect_in_args *in_args,
82 grpc_connect_out_args *out_args,
83 grpc_iomgr_closure *notify);
84
85 #endif
grpc_channel_filter
Definition: channel_stack.h:64
grpc_connector_vtable::ref
void(* ref)(grpc_connector *connector)
Definition: connector.h:71
grpc_connect_in_args::metadata_context
grpc_mdctx * metadata_context
metadata context
Definition: connector.h:59
grpc_connect_in_args::deadline
gpr_timespec deadline
deadline for connection
Definition: connector.h:55
transport.h
grpc_channel_args
An array of arguments that can be passed around.
Definition: grpc.h:113
channel_stack.h
grpc_connect_in_args::addr_len
int addr_len
Definition: connector.h:53
sockaddr.h
connector
Definition: secure_channel_create.c:54
grpc_connector_unref
void grpc_connector_unref(grpc_connector *connector)
Definition: connector.c:40
grpc_connect_out_args::num_filters
size_t num_filters
Definition: connector.h:67
grpc_connector::vtable
const grpc_connector_vtable * vtable
Definition: connector.h:45
grpc_connector_ref
void grpc_connector_ref(grpc_connector *connector)
Definition: connector.c:36
grpc_connector_vtable
Definition: connector.h:70
grpc_connector_connect
void grpc_connector_connect(grpc_connector *connector, const grpc_connect_in_args *in_args, grpc_connect_out_args *out_args, grpc_iomgr_closure *notify)
Definition: connector.c:44
grpc_mdctx
Definition: metadata.c:98
grpc_connector
Definition: connector.h:44
grpc_iomgr_closure
A closure over a grpc_iomgr_cb_func.
Definition: iomgr.h:45
grpc_connect_in_args::interested_parties
grpc_pollset_set * interested_parties
set of pollsets interested in this connection
Definition: connector.h:50
grpc_connect_out_args::transport
grpc_transport * transport
the connected transport
Definition: connector.h:64
grpc_connector_vtable::connect
void(* connect)(grpc_connector *connector, const grpc_connect_in_args *in_args, grpc_connect_out_args *out_args, grpc_iomgr_closure *notify)
Definition: connector.h:73
grpc_connect_out_args
Definition: connector.h:62
grpc_connector_vtable::unref
void(* unref)(grpc_connector *connector)
Definition: connector.h:72
grpc_connect_in_args
Definition: connector.h:48
gpr_timespec
Definition: time.h:60
grpc_connect_out_args::filters
const grpc_channel_filter ** filters
any additional filters (owned by the caller of connect)
Definition: connector.h:66
grpc_pollset_set
Definition: pollset_set_posix.h:40
grpc_connect_in_args::addr
const struct sockaddr * addr
address to connect to
Definition: connector.h:52
grpc_transport
Definition: transport_impl.h:67
grpc_connect_in_args::channel_args
const grpc_channel_args * channel_args
channel arguments (to be passed to transport)
Definition: connector.h:57