summaryrefslogtreecommitdiff
path: root/src/rabbit_net.erl
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-11-30 12:20:12 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2010-11-30 12:20:12 +0000
commit4e9f0dc61d494aded3e6600304215b40a3c8f32d (patch)
tree637582be639da3bcda98a6d64916bca25b1e632b /src/rabbit_net.erl
parent963d834477df9a4bedaca26b13430b6ee8ef2858 (diff)
downloadrabbitmq-server-4e9f0dc61d494aded3e6600304215b40a3c8f32d.tar.gz
experiment with uing {active,once} instead of prim_inet:async_recv
Diffstat (limited to 'src/rabbit_net.erl')
-rw-r--r--src/rabbit_net.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rabbit_net.erl b/src/rabbit_net.erl
index 0940dce2..c9e3cc47 100644
--- a/src/rabbit_net.erl
+++ b/src/rabbit_net.erl
@@ -34,7 +34,7 @@
-export([async_recv/3, close/1, controlling_process/2,
getstat/2, peername/1, peercert/1, port_command/2,
- send/2, sockname/1, is_ssl/1]).
+ send/2, sockname/1, is_ssl/1, setopts/2]).
%%---------------------------------------------------------------------------
@@ -69,6 +69,9 @@
-spec(getstat/2 ::
(socket(), [stat_option()])
-> ok_val_or_error([{stat_option(), integer()}])).
+-spec(setopts/2 :: (socket(), [{atom(), any()} |
+ {raw, non_neg_integer(), non_neg_integer(),
+ binary()}]) -> ok_or_any_error()).
-endif.
@@ -137,3 +140,8 @@ sockname(Sock) when is_port(Sock) ->
is_ssl(Sock) ->
?IS_SSL(Sock).
+
+setopts(Sock, Options) when ?IS_SSL(Sock) ->
+ ssl:setopts(Sock#ssl_socket.ssl, Options);
+setopts(Sock, Options) when is_port(Sock) ->
+ inet:setopts(Sock, Options).