|
@@ -26,6 +26,7 @@
|
|
|
-export([accept/2]).
|
|
|
-export([accept_ack/2]).
|
|
|
-export([connect/3]).
|
|
|
+-export([connect/4]).
|
|
|
-export([recv/3]).
|
|
|
-export([send/2]).
|
|
|
-export([sendfile/2]).
|
|
@@ -104,6 +105,18 @@ connect(Host, Port, Opts) when is_integer(Port) ->
|
|
|
gen_tcp:connect(Host, Port,
|
|
|
Opts ++ [binary, {active, false}, {packet, raw}]).
|
|
|
|
|
|
+%% @private Experimental. Open a connection to the given host and port
|
|
|
+%% number with a timeout.
|
|
|
+%% @see gen_tcp:connect/4
|
|
|
+%% @todo Probably filter Opts?
|
|
|
+-spec connect(inet:ip_address() | inet:hostname(),
|
|
|
+ inet:port_number(), any(), timeout())
|
|
|
+ -> {ok, inet:socket()} | {error, atom()}.
|
|
|
+connect(Host, Port, Opts, Timeout) when is_integer(Port) ->
|
|
|
+ gen_tcp:connect(Host, Port,
|
|
|
+ Opts ++ [binary, {active, false}, {packet, raw}],
|
|
|
+ Timeout).
|
|
|
+
|
|
|
%% @doc Receive data from a socket in passive mode.
|
|
|
%% @see gen_tcp:recv/3
|
|
|
-spec recv(inet:socket(), non_neg_integer(), timeout())
|