Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

修改transport ,支持opts

  • Loading branch information...
commit d36777d5f3f12f1478b73b730ff9182ac54bd249 1 parent b7a9d3e
@dp0304 authored
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/daccpol_tcp_transport.erl
View
13 src/daccpol_tcp_transport.erl
@@ -45,13 +45,12 @@ connect(Host, Port, Opts) when is_list(Host), is_integer(Port) ->
listen(Opts) ->
{port, Port} = lists:keyfind(port, 1, Opts),
Backlog = proplists:get_value(backlog, Opts, 1024),
- ListenOpts0 = [binary, {active, false},
- {backlog, Backlog}, {packet, raw}, {reuseaddr, true}],
- ListenOpts =
- case lists:keyfind(ip, 1, Opts) of
- false -> ListenOpts0;
- Ip -> [Ip|ListenOpts0]
- end,
+ Packet = proplists:get_value(packet, Opts, 0),
+ Active = proplists:get_value(active, Opts, false),
+
+ ListenOpts = [binary, {active, Active},
+ {backlog, Backlog}, {packet, Packet}, {reuseaddr, true}],
+
gen_tcp:listen(Port, ListenOpts).
Please sign in to comment.
Something went wrong with that request. Please try again.