0

我正在尝试使用 inet 的 tftp,但我做错了一些事情。这个简单的示例应用程序虽然绑定到正确的端口,但从不向客户端返回数据。

要重现,请在项目根目录中打开一个终端,然后:

make && ./bin/console

这应该会启动 tftp_hellp 应用程序,并将您放入 erlang shell。确认 inets 正在运行:

1> application:which_applications().
[{inets,"INETS  CXC 138 49","5.9"},
 {sasl,"SASL  CXC 138 11","2.2.1"},
 {stdlib,"ERTS  CXC 138 10","1.18.1"},
 {kernel,"ERTS  CXC 138 10","2.15.1"}]

并且 tftp 守护进程正在运行:

2> inets:services().
[{tftpd,<0.56.0>},{httpc,<0.50.0>}]

伟大的。现在,如果您查看,etc/inets.config您会注意到我们将 tftpd 绑定到 6969。打开另一个终端并:

> tftp localhost 6969
tftp> get hello.txt
Transfer timed out.

打扰。如果我对 tftpd 的理解是正确的——显然不是——我们会<<"hello world">>回来的。

我究竟做错了什么?

4

1 回答 1

1

我最初收到了同样的错误,但后来检查了我的防火墙设置以允许 udp/6969 并获得了文件:

-> % tftp localhost 6969

tftp> get hello.txt

Received 11 bytes in 0.0 seconds

tftp> quit

-> % cat hello.txt

hello world%

于 2012-07-30T17:44:45.443 回答