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
ba947488
Commit
ba947488
authored
8 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Add error propagation
parent
0ca68b7c
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
src/core/lib/iomgr/socket_utils_common_posix.c
+8
-4
8 additions, 4 deletions
src/core/lib/iomgr/socket_utils_common_posix.c
src/core/lib/iomgr/socket_utils_posix.h
+4
-9
4 additions, 9 deletions
src/core/lib/iomgr/socket_utils_posix.h
with
12 additions
and
13 deletions
src/core/lib/iomgr/socket_utils_common_posix.c
+
8
−
4
View file @
ba947488
...
@@ -117,14 +117,18 @@ grpc_error *grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
...
@@ -117,14 +117,18 @@ grpc_error *grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
return
GRPC_ERROR_NONE
;
return
GRPC_ERROR_NONE
;
}
}
int
grpc_set_socket_sndbuf
(
int
fd
,
int
buffer_size_bytes
)
{
grpc_error
*
grpc_set_socket_sndbuf
(
int
fd
,
int
buffer_size_bytes
)
{
return
0
==
setsockopt
(
fd
,
SOL_SOCKET
,
SO_SNDBUF
,
&
buffer_size_bytes
,
return
0
==
setsockopt
(
fd
,
SOL_SOCKET
,
SO_SNDBUF
,
&
buffer_size_bytes
,
sizeof
(
buffer_size_bytes
));
sizeof
(
buffer_size_bytes
))
?
GRPC_ERROR_NONE
:
GRPC_OS_ERROR
(
errno
,
"setsockopt(SO_SNDBUF)"
);
}
}
int
grpc_set_socket_rcvbuf
(
int
fd
,
int
buffer_size_bytes
)
{
grpc_error
*
grpc_set_socket_rcvbuf
(
int
fd
,
int
buffer_size_bytes
)
{
return
0
==
setsockopt
(
fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
buffer_size_bytes
,
return
0
==
setsockopt
(
fd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
buffer_size_bytes
,
sizeof
(
buffer_size_bytes
));
sizeof
(
buffer_size_bytes
))
?
GRPC_ERROR_NONE
:
GRPC_OS_ERROR
(
errno
,
"setsockopt(SO_RCVBUF)"
);
}
}
/* set a socket to close on exec */
/* set a socket to close on exec */
...
...
This diff is collapsed.
Click to expand it.
src/core/lib/iomgr/socket_utils_posix.h
+
4
−
9
View file @
ba947488
...
@@ -66,27 +66,22 @@ grpc_error *grpc_set_socket_low_latency(int fd, int low_latency);
...
@@ -66,27 +66,22 @@ grpc_error *grpc_set_socket_low_latency(int fd, int low_latency);
int
grpc_ipv6_loopback_available
(
void
);
int
grpc_ipv6_loopback_available
(
void
);
/* Tries to set SO_NOSIGPIPE if available on this platform.
/* Tries to set SO_NOSIGPIPE if available on this platform.
Returns 1 on success, 0 on failure.
If SO_NO_SIGPIPE is not available, returns 1. */
If SO_NO_SIGPIPE is not available, returns 1. */
grpc_error
*
grpc_set_socket_no_sigpipe_if_possible
(
int
fd
);
grpc_error
*
grpc_set_socket_no_sigpipe_if_possible
(
int
fd
);
/* Tries to set IP_PKTINFO if available on this platform.
/* Tries to set IP_PKTINFO if available on this platform.
Returns 1 on success, 0 on failure.
If IP_PKTINFO is not available, returns 1. */
If IP_PKTINFO is not available, returns 1. */
grpc_error
*
grpc_set_socket_ip_pktinfo_if_possible
(
int
fd
);
grpc_error
*
grpc_set_socket_ip_pktinfo_if_possible
(
int
fd
);
/* Tries to set IPV6_RECVPKTINFO if available on this platform.
/* Tries to set IPV6_RECVPKTINFO if available on this platform.
Returns 1 on success, 0 on failure.
If IPV6_RECVPKTINFO is not available, returns 1. */
If IPV6_RECVPKTINFO is not available, returns 1. */
grpc_error
*
grpc_set_socket_ipv6_recvpktinfo_if_possible
(
int
fd
);
grpc_error
*
grpc_set_socket_ipv6_recvpktinfo_if_possible
(
int
fd
);
/* Tries to set the socket's send buffer to given size.
/* Tries to set the socket's send buffer to given size. */
Returns 1 on success, 0 on failure. */
grpc_error
*
grpc_set_socket_sndbuf
(
int
fd
,
int
buffer_size_bytes
);
int
grpc_set_socket_sndbuf
(
int
fd
,
int
buffer_size_bytes
);
/* Tries to set the socket's receive buffer to given size.
/* Tries to set the socket's receive buffer to given size. */
Returns 1 on success, 0 on failure. */
grpc_error
*
grpc_set_socket_rcvbuf
(
int
fd
,
int
buffer_size_bytes
);
int
grpc_set_socket_rcvbuf
(
int
fd
,
int
buffer_size_bytes
);
/* An enum to keep track of IPv4/IPv6 socket modes.
/* An enum to keep track of IPv4/IPv6 socket modes.
...
...
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