diff options
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/test/socket_client.erl | 33 | ||||
-rw-r--r-- | lib/kernel/test/socket_server.erl | 21 |
2 files changed, 31 insertions, 23 deletions
diff --git a/lib/kernel/test/socket_client.erl b/lib/kernel/test/socket_client.erl index dce50682ab..6c6dc0444c 100644 --- a/lib/kernel/test/socket_client.erl +++ b/lib/kernel/test/socket_client.erl @@ -71,19 +71,20 @@ do_start(Domain, stream = Type, Proto, SA) -> try do_init(Domain, Type, Proto) of Sock -> connect(Sock, SA), - {ok, Name} = socket:sockname(Sock), - {ok, Peer} = socket:peername(Sock), - {ok, Domain} = socket:getopt(Sock, socket, domain), - {ok, Type} = socket:getopt(Sock, socket, type), - {ok, Proto} = socket:getopt(Sock, socket, protocol), - {ok, OOBI} = socket:getopt(Sock, socket, oobinline), - {ok, SndBuf} = socket:getopt(Sock, socket, sndbuf), - {ok, RcvBuf} = socket:getopt(Sock, socket, rcvbuf), - {ok, Linger} = socket:getopt(Sock, socket, linger), - {ok, MTU} = socket:getopt(Sock, ip, mtu), - {ok, MIF} = socket:getopt(Sock, ip, multicast_if), - {ok, MLoop} = socket:getopt(Sock, ip, multicast_loop), - {ok, MTTL} = socket:getopt(Sock, ip, multicast_ttl), + {ok, Name} = socket:sockname(Sock), + {ok, Peer} = socket:peername(Sock), + {ok, Domain} = socket:getopt(Sock, socket, domain), + {ok, Type} = socket:getopt(Sock, socket, type), + {ok, Proto} = socket:getopt(Sock, socket, protocol), + {ok, OOBI} = socket:getopt(Sock, socket, oobinline), + {ok, SndBuf} = socket:getopt(Sock, socket, sndbuf), + {ok, RcvBuf} = socket:getopt(Sock, socket, rcvbuf), + {ok, Linger} = socket:getopt(Sock, socket, linger), + {ok, MTU} = socket:getopt(Sock, ip, mtu), + {ok, MTUDisc} = socket:getopt(Sock, ip, mtu_discover), + {ok, MIF} = socket:getopt(Sock, ip, multicast_if), + {ok, MLoop} = socket:getopt(Sock, ip, multicast_loop), + {ok, MTTL} = socket:getopt(Sock, ip, multicast_ttl), i("connected: " "~n From: ~p" "~n To: ~p" @@ -96,13 +97,15 @@ do_start(Domain, stream = Type, Proto, SA) -> "~n (socket) RcvBuf: ~p" "~n (socket) Linger: ~p" "~n (ip) MTU: ~p" + "~n (ip) MTU Discovery: ~p" "~n (ip) Multicast IF: ~p" "~n (ip) Multicast Loop: ~p" "~n (ip) Multicast TTL: ~p" "~n => wait some", [Name, Peer, - Domain, Type, Proto, - OOBI, SndBuf, RcvBuf, Linger, MTU, MIF, MLoop, MTTL]), + Domain, Type, Proto, + OOBI, SndBuf, RcvBuf, Linger, + MTU, MTUDisc, MIF, MLoop, MTTL]), %% Give the server some time... ?LIB:sleep(5000), %% ok = socket:close(Sock), diff --git a/lib/kernel/test/socket_server.erl b/lib/kernel/test/socket_server.erl index f77c91996f..68a6aebc50 100644 --- a/lib/kernel/test/socket_server.erl +++ b/lib/kernel/test/socket_server.erl @@ -435,6 +435,13 @@ handler_init(Manager, ID, Peek, Sock) -> {handler, Pid, Ref, continue} -> i("got continue"), handler_reply(Pid, Ref, ok), + G = fun(K) -> case socket:getopt(Sock, ip, K) of + {ok, Val} -> + f("~w", [Val]); + {error, _} -> + "-" + end + end, {ok, Domain} = socket:getopt(Sock, socket, domain), {ok, Type} = socket:getopt(Sock, socket, type), {ok, Proto} = socket:getopt(Sock, socket, protocol), @@ -442,12 +449,8 @@ handler_init(Manager, ID, Peek, Sock) -> {ok, SndBuf} = socket:getopt(Sock, socket, sndbuf), {ok, RcvBuf} = socket:getopt(Sock, socket, rcvbuf), {ok, Linger} = socket:getopt(Sock, socket, linger), - MTU = case socket:getopt(Sock, ip, mtu) of - {ok, Val} -> - f("~w", [Val]); - {error, _} -> - "-" % We don't connect UDP (it can be done but we don't) - end, + MTU = G(mtu), + MTUDisc = G(mtu_discover), {ok, MIF} = socket:getopt(Sock, ip, multicast_if), {ok, MLoop} = socket:getopt(Sock, ip, multicast_loop), {ok, MTTL} = socket:getopt(Sock, ip, multicast_ttl), @@ -460,11 +463,13 @@ handler_init(Manager, ID, Peek, Sock) -> "~n (socket) RcvBuf: ~p" "~n (socket) Linger: ~p" "~n (ip) MTU: ~s" + "~n (ip) MTU Discovery: ~s" "~n (ip) Multicast IF: ~p" "~n (ip) Multicast Loop: ~p" "~n (ip) Multicast TTL: ~p", - [Domain, Type, Proto, - OOBI, SndBuf, RcvBuf, Linger, MTU, MIF, MLoop, MTTL]), + [Domain, Type, Proto, + OOBI, SndBuf, RcvBuf, Linger, + MTU, MTUDisc, MIF, MLoop, MTTL]), %% socket:setopt(Sock, otp, debug, true), handler_loop(#handler{peek = Peek, manager = Manager, |