我試圖使這個應用FIX protocol二郎:與牧場
我開始使用erl -pa ./ebin -pa ebin ./deps/*/ebin
Erlang的外殼連接錯誤的誤解。 然後像這樣運行應用程序:application:start(fix)
。 之後,我調用這樣的「start_listener」函數:fix:start_listener()
。 因此出現此錯誤:
exception error: no match of right hand side value
{error,
{{shutdown,
{failed_to_start_child,ranch_acceptors_sup,
badarg}},
{child,undefined,
{ranch_listener_sup,fix_listener},
{ranch_listener_sup,start_link,
[fix_listener,10,ranch_tcp,
[{port,[8501]}],
fix_server,[]]},
permanent,5000,supervisor,
[ranch_listener_sup]}}}
in function fix:start_listener/0 (src/fix.erl, line 21)
這是什麼意思?以及如何解決這個錯誤?
我的代碼是:
`-module(fix).
-author('Max Lapshin <[email protected]>').
-include("log.hrl").
% -include("../include/admin.hrl").
-include("../include/business.hrl").
-compile(export_all).
%% @doc Start acceptor with `ranch' on port, specified in application environment under fix_port%%
-spec start_listener() -> {ok, pid()}.
start_listener() ->
application:start(ranch),
Spec = ranch:child_spec(fix_listener, 10,
ranch_tcp, [{port, fix:get_value(fix_port)}],
fix_server, []
),
{ok, Pid} = supervisor:start_child(fix_sup, Spec),
error_logger:info_msg("Starting FIX server on port ~p~n",[fix:get_value(fix_port)]),
{ok, Pid}.
` 這是一段代碼,顯示一個錯誤。
請顯示您的代碼。 –