Skip to content

Commit

Permalink
Use defaults, {active, true} and {packet,0} for simplicity.
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Jan 12, 2010
1 parent 340157f commit ac18f27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/echo.erl
Expand Up @@ -45,7 +45,7 @@ start(Port, Options) ->
listen(Protocol, Fd, Port).

listen(tcp, Fd, Port) ->
{ok, S} = gen_tcp:listen(Port, [binary, {packet, 0}, {fd, Fd}]),
{ok, S} = gen_tcp:listen(Port, [binary, {fd, Fd}]),
accept(S);
listen(udp, Fd, Port) ->
{ok, S} = gen_udp:open(Port, [binary, {fd, Fd}]),
Expand All @@ -57,7 +57,6 @@ accept(LS) ->
recv(S).

recv(S) ->
inet:setopts(S, [{active, once}]),
receive
{tcp, S, Data} ->
gen_tcp:send(S, Data),
Expand Down

0 comments on commit ac18f27

Please sign in to comment.