Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:20
gen_rpc
0001-Fix-sol_socket-to-sol_tcp-issue-due-to-API...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fix-sol_socket-to-sol_tcp-issue-due-to-API-change-79.patch of Package gen_rpc
From d0b62e85f177ab499a819eda31c0becd11f7a8b9 Mon Sep 17 00:00:00 2001 From: cyy <chenyayan0929@gmail.com> Date: Thu, 20 Dec 2018 12:52:37 +0800 Subject: [PATCH] Fix sol_socket to sol_tcp issue due to API change (#79) --- include/tcp.hrl | 1 + src/driver/gen_rpc_driver_tcp.erl | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/tcp.hrl b/include/tcp.hrl index 94f9e5a..68e356f 100644 --- a/include/tcp.hrl +++ b/include/tcp.hrl @@ -42,6 +42,7 @@ -define(DARWIN_TCP_KEEPCNT, 16#102). % number of keepalives before close -define(LINUX_SOL_SOCKET, 16#0001). +-define(LINUX_SOL_TCP, 16#0006). -define(LINUX_SO_KEEPALIVE, 16#0009). -define(LINUX_TCP_KEEPIDLE, 16#4). % idle time used when SO_KEEPALIVE is enabled -define(LINUX_TCP_KEEPINTVL, 16#5). % interval between keepalives diff --git a/src/driver/gen_rpc_driver_tcp.erl b/src/driver/gen_rpc_driver_tcp.erl index 0d8f374..5c87124 100644 --- a/src/driver/gen_rpc_driver_tcp.erl +++ b/src/driver/gen_rpc_driver_tcp.erl @@ -215,9 +215,9 @@ set_socket_keepalive({unix, linux}, Socket) -> {ok, KeepInterval} = application:get_env(?APP, socket_keepalive_interval), {ok, KeepCount} = application:get_env(?APP, socket_keepalive_count), ok = inet:setopts(Socket, [{raw, ?LINUX_SOL_SOCKET, ?LINUX_SO_KEEPALIVE, <<1:32/native>>}]), - ok = inet:setopts(Socket, [{raw, ?LINUX_SOL_SOCKET, ?LINUX_TCP_KEEPIDLE, <<KeepIdle:32/native>>}]), - ok = inet:setopts(Socket, [{raw, ?LINUX_SOL_SOCKET, ?LINUX_TCP_KEEPINTVL, <<KeepInterval:32/native>>}]), - ok = inet:setopts(Socket, [{raw, ?LINUX_SOL_SOCKET, ?LINUX_TCP_KEEPCNT, <<KeepCount:32/native>>}]), + ok = inet:setopts(Socket, [{raw, ?LINUX_SOL_TCP, ?LINUX_TCP_KEEPIDLE, <<KeepIdle:32/native>>}]), + ok = inet:setopts(Socket, [{raw, ?LINUX_SOL_TCP, ?LINUX_TCP_KEEPINTVL, <<KeepInterval:32/native>>}]), + ok = inet:setopts(Socket, [{raw, ?LINUX_SOL_TCP, ?LINUX_TCP_KEEPCNT, <<KeepCount:32/native>>}]), ok; set_socket_keepalive(_Unsupported, _Socket) -> -- 2.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor