From eec2e40258becbd7fcafcbf6534890a51851f07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 12 Nov 2012 19:25:05 +0100 Subject: Allow IP tuples and more when connecting transports --- src/ranch_tcp.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ranch_tcp.erl') diff --git a/src/ranch_tcp.erl b/src/ranch_tcp.erl index 18322db..3c918ea 100644 --- a/src/ranch_tcp.erl +++ b/src/ranch_tcp.erl @@ -83,9 +83,10 @@ accept(LSocket, Timeout) -> %% @private Experimental. Open a connection to the given host and port number. %% @see gen_tcp:connect/3 %% @todo Probably filter Opts? --spec connect(string(), inet:port_number(), any()) +-spec connect(inet:ip_address() | inet:hostname(), + inet:port_number(), any()) -> {ok, inet:socket()} | {error, atom()}. -connect(Host, Port, Opts) when is_list(Host), is_integer(Port) -> +connect(Host, Port, Opts) when is_integer(Port) -> gen_tcp:connect(Host, Port, Opts ++ [binary, {active, false}, {packet, raw}]). -- cgit v1.2.3