[erlang-questions] ssh_connection.exec/4 response length limit

Rubén Caro ruben.caro.estevez@REDACTED
Sat Jan 16 12:08:02 CET 2016


Hello,

When I run this:

-----------------------------
ssh:start().
{ok, Conn} = ssh:connect("myip", 22, [ {user,"myuser"} ], 5000).
{ok, Channel} = ssh_connection:session_channel(Conn, 5000).

L = fun Loop(N) ->
 receive
   {ssh_cm,_,{_,_,_,Data}} ->
     Loop(N + byte_size(Data))
 after
   5000 -> io:format("~p~n",[N])
 end
end.

ssh_connection:exec(Conn, Channel, "yes", 5000).

L(0).
-----------------------------

I get the magic number 65536. A 'flush().' only says 'ok'. So no more
messages on my inbox.

This happens running any command that generates a long enough output, not
only 'yes'. Anything like 'while true; do echo; done;' or 'cat
longenough.txt' would hit a similar limit.

Why is that? Can I go past this limit?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160116/bbf2656b/attachment.htm>


More information about the erlang-questions mailing list