当我在 erl shell 中启动一个函数时,它工作正常。当我尝试使用 erl ... -s 模块函数调用相同的函数时,它失败了。
最终失败的代码行是:
start(Port) ->
mochiweb_http:start([{port, Port}, {loop, fun dispatch_requests/1}]).
我很肯定端口设置正确。我的错误信息是:
=CRASH REPORT==== 17-Jan-2010::00:21:09 ===
crasher:
initial call: mochiweb_socket_server:acceptor_loop/1
pid: <0.65.0>
registered_name: []
exception exit: {error,closed}
in function mochiweb_socket_server:acceptor_loop/1
ancestors: [mochiweb_http,<0.1.0>]
messages: []
links: []
dictionary: []
trap_exit: false
status: running
heap_size: 377
stack_size: 24
reductions: 93
neighbours:
我尝试了调试器,它让我可以单步执行,直到给出上面的代码行。在我通过之后,它给了我这个崩溃报告。
任何帮助是极大的赞赏。