Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
dbdc6e4a
Commit
dbdc6e4a
authored
8 years ago
by
Adam Czachorowski
Browse files
Options
Downloads
Patches
Plain Diff
Add method for creating insecure channel from FD with custom arguments
using C++ API. This was already supported in C API.
parent
93b09478
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/grpc++/create_channel_posix.h
+10
-0
10 additions, 0 deletions
include/grpc++/create_channel_posix.h
src/cpp/client/create_channel_posix.cc
+10
-0
10 additions, 0 deletions
src/cpp/client/create_channel_posix.cc
with
20 additions
and
0 deletions
include/grpc++/create_channel_posix.h
+
10
−
0
View file @
dbdc6e4a
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include
<memory>
#include
<memory>
#include
<grpc++/channel.h>
#include
<grpc++/channel.h>
#include
<grpc++/support/channel_arguments.h>
#include
<grpc/support/port_platform.h>
#include
<grpc/support/port_platform.h>
namespace
grpc
{
namespace
grpc
{
...
@@ -50,6 +51,15 @@ namespace grpc {
...
@@ -50,6 +51,15 @@ namespace grpc {
std
::
shared_ptr
<
Channel
>
CreateInsecureChannelFromFd
(
const
grpc
::
string
&
target
,
std
::
shared_ptr
<
Channel
>
CreateInsecureChannelFromFd
(
const
grpc
::
string
&
target
,
int
fd
);
int
fd
);
/// Create a new \a Channel communicating over given file descriptor with custom
/// channel arguments
///
/// \param target The name of the target.
/// \param fd The file descriptor representing a socket.
/// \param args Options for channel creation.
std
::
shared_ptr
<
Channel
>
CreateCustomInsecureChannelFromFd
(
const
grpc
::
string
&
target
,
int
fd
,
const
ChannelArguments
&
args
);
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
}
// namespace grpc
}
// namespace grpc
...
...
This diff is collapsed.
Click to expand it.
src/cpp/client/create_channel_posix.cc
+
10
−
0
View file @
dbdc6e4a
...
@@ -51,6 +51,16 @@ std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target,
...
@@ -51,6 +51,16 @@ std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target,
""
,
grpc_insecure_channel_create_from_fd
(
target
.
c_str
(),
fd
,
nullptr
));
""
,
grpc_insecure_channel_create_from_fd
(
target
.
c_str
(),
fd
,
nullptr
));
}
}
std
::
shared_ptr
<
Channel
>
CreateCustomInsecureChannelFromFd
(
const
grpc
::
string
&
target
,
int
fd
,
const
ChannelArguments
&
args
)
{
internal
::
GrpcLibrary
init_lib
;
init_lib
.
init
();
grpc_channel_args
channel_args
;
args
.
SetChannelArgs
(
&
channel_args
);
return
CreateChannelInternal
(
""
,
grpc_insecure_channel_create_from_fd
(
target
.
c_str
(),
fd
,
&
channel_args
));
}
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
}
// namespace grpc
}
// namespace grpc
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment