aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/dist_util.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-06-14 18:42:33 +0200
committerSverker Eriksson <[email protected]>2016-08-15 17:37:13 +0200
commit8f03f5dc4c8bc2804acfaec5d3558456d27282b0 (patch)
treeda580c42255b3ea7695f4dd4a84fa4612bb6f2b1 /lib/kernel/src/dist_util.erl
parentfec9c26cf1746898a76043df7f2d0bebfa36c927 (diff)
downloadotp-8f03f5dc4c8bc2804acfaec5d3558456d27282b0.tar.gz
otp-8f03f5dc4c8bc2804acfaec5d3558456d27282b0.tar.bz2
otp-8f03f5dc4c8bc2804acfaec5d3558456d27282b0.zip
kernel: Add net_kernel:setopts/2 and getopts/2
Diffstat (limited to 'lib/kernel/src/dist_util.erl')
-rw-r--r--lib/kernel/src/dist_util.erl22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl
index 8509a01608..d8e4705e6b 100644
--- a/lib/kernel/src/dist_util.erl
+++ b/lib/kernel/src/dist_util.erl
@@ -355,7 +355,9 @@ connection(#hs_data{other_node = Node,
Socket,
PType,
HSData#hs_data.mf_tick,
- HSData#hs_data.mf_getstat},
+ HSData#hs_data.mf_getstat,
+ HSData#hs_data.mf_setopts,
+ HSData#hs_data.mf_getopts},
#tick{});
_ ->
?shutdown2(Node, connection_setup_failed)
@@ -452,7 +454,7 @@ mark_nodeup(#hs_data{kernel_pid = Kernel,
?shutdown(Node)
end.
-con_loop({Kernel, Node, Socket, Type, MFTick, MFGetstat}=ConData,
+con_loop({Kernel, Node, Socket, Type, MFTick, MFGetstat, MFSetOpts, MFGetOpts}=ConData,
Tick) ->
receive
{tcp_closed, Socket} ->
@@ -487,7 +489,21 @@ con_loop({Kernel, Node, Socket, Type, MFTick, MFGetstat}=ConData,
con_loop(ConData, Tick);
_ ->
?shutdown2(Node, get_status_failed)
- end
+ end;
+ {From, Ref, {setopts, Opts}} ->
+ Ret = case MFSetOpts of
+ undefined -> {error, enotsup};
+ _ -> MFSetOpts(Socket, Opts)
+ end,
+ From ! {Ref, Ret},
+ con_loop(ConData, Tick);
+ {From, Ref, {getopts, Opts}} ->
+ Ret = case MFGetOpts of
+ undefined -> {error, enotsup};
+ _ -> MFGetOpts(Socket, Opts)
+ end,
+ From ! {Ref, Ret},
+ con_loop(ConData, Tick)
end.