diff options
author | Micael Karlberg <[email protected]> | 2018-05-08 15:45:48 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 13:01:37 +0200 |
commit | 0f2b8a76edaa462fca388a55eaf449a36296820a (patch) | |
tree | d2ec1f07e9a9d93329b88137ca34c5b2d39d4bd8 /erts/preloaded/src/socket.erl | |
parent | 3d719906dd0ad8d07547c3a20a2190a416dda364 (diff) | |
download | otp-0f2b8a76edaa462fca388a55eaf449a36296820a.tar.gz otp-0f2b8a76edaa462fca388a55eaf449a36296820a.tar.bz2 otp-0f2b8a76edaa462fca388a55eaf449a36296820a.zip |
[socket-nif] setopt of socket option broadcast
Diffstat (limited to 'erts/preloaded/src/socket.erl')
-rw-r--r-- | erts/preloaded/src/socket.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/erts/preloaded/src/socket.erl b/erts/preloaded/src/socket.erl index f1b5623362..f40fd81d36 100644 --- a/erts/preloaded/src/socket.erl +++ b/erts/preloaded/src/socket.erl @@ -432,6 +432,7 @@ -define(SOCKET_OPT_OTP_DEBUG, 0). -define(SOCKET_OPT_OTP_IOW, 1). +-define(SOCKET_OPT_SOCK_BROADCAST, 4). -define(SOCKET_OPT_SOCK_DONTROUTE, 7). -define(SOCKET_OPT_SOCK_KEEPALIVE, 9). -define(SOCKET_OPT_SOCK_LINGER, 10). @@ -1610,6 +1611,8 @@ enc_setopt_value(otp, iow, V, _, _, _) when is_boolean(V) -> enc_setopt_value(otp = L, Opt, V, _D, _T, _P) -> not_supported({L, Opt, V}); +enc_setopt_value(socket, broadcast, V, _D, _T, _P) when is_boolean(V) -> + V; enc_setopt_value(socket, keepalive, V, _D, _T, _P) when is_boolean(V) -> V; enc_setopt_value(socket, linger, abort, D, T, P) -> @@ -1798,8 +1801,8 @@ enc_sockopt_key(socket, acceptfilter = Opt, _Dir, _D, _T, _P) -> %% So, we let the implementation decide. enc_sockopt_key(socket, bindtodevide = Opt, _Dir, _D, _T, _P) -> not_supported(Opt); -enc_sockopt_key(socket, broadcast = Opt, _Dir, _D, dgram = _T, _P) -> - not_supported(Opt); +enc_sockopt_key(socket, broadcast = _Opt, _Dir, _D, dgram = _T, _P) -> + ?SOCKET_OPT_SOCK_BROADCAST; enc_sockopt_key(socket, busy_poll = Opt, _Dir, _D, _T, _P) -> not_supported(Opt); enc_sockopt_key(socket, debug = Opt, _Dir, _D, _T, _P) -> |