aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-05-10 15:18:55 +0200
committerMicael Karlberg <[email protected]>2019-06-24 15:12:30 +0200
commitb7b650e20da47861f3d2e5ac32f720056391bf43 (patch)
treeb16dbc74a31e60feb61de31c54d9b7ff7c9c08dc /erts/preloaded
parentcd0f46d1f286b28d1289c2be4218c83b980f241d (diff)
downloadotp-b7b650e20da47861f3d2e5ac32f720056391bf43.tar.gz
otp-b7b650e20da47861f3d2e5ac32f720056391bf43.tar.bz2
otp-b7b650e20da47861f3d2e5ac32f720056391bf43.zip
[esock] Add debug function
Introduced a debug/1 function and made the command/1 internal. OTP-15817
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/ebin/socket.beambin75444 -> 75584 bytes
-rw-r--r--erts/preloaded/src/socket.erl19
2 files changed, 14 insertions, 5 deletions
diff --git a/erts/preloaded/ebin/socket.beam b/erts/preloaded/ebin/socket.beam
index d19e0c40b4..c4680c2baa 100644
--- a/erts/preloaded/ebin/socket.beam
+++ b/erts/preloaded/ebin/socket.beam
Binary files differ
diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl
index 3a43504f8f..e9a76dc1e9 100644
--- a/erts/preloaded/src/socket.erl
+++ b/erts/preloaded/src/socket.erl
@@ -29,7 +29,8 @@
ensure_sockaddr/1,
- command/1,
+ debug/1,
+ %% command/1,
info/0,
supports/0, supports/1, supports/2, supports/3
]).
@@ -66,7 +67,7 @@
select_ref/0,
select_info/0,
- command/0,
+ %% command/0,
domain/0,
type/0,
@@ -150,7 +151,7 @@
command := debug,
data := boolean()
}.
--type command() :: debug_command().
+%% -type command() :: debug_command().
-type uint8() :: 0..16#FF.
-type uint16() :: 0..16#FFFF.
@@ -884,8 +885,16 @@ info() ->
nif_info().
--spec command(Command) -> term() when
- Command :: command().
+-spec debug(D) -> ok when
+ D :: boolean().
+
+debug(D) when is_boolean(D) ->
+ command(#{command => debug,
+ data => D}).
+
+
+-spec command(Command) -> ok when
+ Command :: debug_command().
command(#{command := debug,
data := Dbg} = Command) when is_boolean(Dbg) ->