[erlang-questions] In what way am I misusing inet's tftpd?

35 views
Skip to first unread message

Brian L. Troutwine

unread,
Jul 27, 2012, 5:37:56 PM7/27/12
to erlang-q...@erlang.org
I'm attempting to use inet's tftp, but I'm doing something incorrectly. I have a simple example application here: https://github.com/blt/tftp-problems While tftp-problemst does bind to the correct port, it never returns data to a client.

To reproduce, open a terminal in the project root and:

make && ./bin/console

This should boot the tftp_hellp application, and drop you into an erlang shell. Confirm that inets is running:

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"}]

and that the tftp daemon is running:

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

Great. Now, if you look in `etc/inets.config` you'll notice we're binding tftpd to 6969. Open another terminal and:

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

Bother. If my understanding of tftpd were correct--which clearly it's not--we'd get `<<"hello world">>` back.

What am I doing wrong?

- blt
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Håkan Mattsson

unread,
Sep 4, 2012, 7:57:26 AM9/4/12
to Brian L. Troutwine, erlang-q...@erlang.org
Hi!

You can check your actual tftp server configuration with:

tftp:info(daemons).

and you can debug with

tftp:change_config(daemons, [{debug,Level}]). % Level = none |
error | warning | brief | normal | verbose | all

Once you have connected to port 6969 (with tftp localhost 6969) you
can inspect the config for the server process for that session with

tftp:info(servers).

and start debugging with

tftp:change_config(servers, [{debug,Level}]). % Level = none |
error | warning | brief | normal | verbose | all

hopefully you will see what the server does with your messages.

/Håkan
Reply all
Reply to author
Forward
0 new messages