Erlang VM -s参数行为不正 [英] Erlang VM -s argument misbehaving

查看:197
本文介绍了Erlang VM -s参数行为不正的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在erl shell中启动一个功能时,工作正常。当我尝试使用erl ... -s模块函数调用相同的函数时,它将失败。

When I start up a function within the erl shell, it works fine. When I try to invoke the same function with erl ... -s module function, it fails.

最终失败的代码行是:

start(Port) ->
    mochiweb_http:start([{port, Port}, {loop, fun dispatch_requests/1}]).

我肯定端口设置正确。我的错误信息是:

I'm positive that Port is set correctly. My error message is:

=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:

我尝试过调试器,它让我步直到上面的代码行被给出。通过之后,它给了我这个崩溃报告。

I tried the debugger and it lets me step through right up until the line of code above is given. After I pass that, it gives me this crash report.

非常感谢任何帮助。

推荐答案

嗯,我认为应该工作。
所有模块是否使用相同的编译器版本进行编译?如果没有,IIRC可能在套接字级别有奇怪的错误。
BTW,你可能会调用你的入门点函数start,这是-s的默认值。

Hm, I think that should work. Are all modules compiled with the same compiler version? IIRC there might be weird errors on the socket level if not. BTW, you might call your entry point function start which is the default for -s.

这篇关于Erlang VM -s参数行为不正的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆