To telnet or to netcat... that's the question

Bryn M. Reeves bmr at redhat.com
Fri Aug 31 13:14:33 UTC 2012


On 08/31/2012 01:41 PM, NOSpaze wrote:
> But if I use nc and do...
> 
>         # nc 127.0.0.1 5038 << EOF
>         > Action: Login
>         > ActionID: 1
>         > Username: youwanna
>         > Secret: uwanna
>         > 
>         > EOF
>         Asterisk Call Manager/1.0

Does the behaviour differ if you type or paste the lines in and then hit
Ctrl-D (or your keybinding for EOF) rather than use a shell here document?

I think this might cause nc to send one big packet with all the lines
which might not be what asterisk expects. I'd also expect telnet to turn
of nagling on the socket (so data is sent immediately rather than
buffering). I think nc doesn't do that although it does provide a
configurable send/receive delay interval (-i).

Failing that I would try a tethereal/tcpdump to see what's different in
the data going over the wire.

Regards,
Bryn.



More information about the users mailing list