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

Rubén Caro <>
Sat Jan 16 17:08:17 CET 2016


Of course it worked!

Many thanks ( see https://github.com/rubencaro/sshex/issues/4 ).

2016-01-16 15:42 GMT+01:00 Tony Rogvall <>:

> You must adjust the window:
>
> Add
>         ssh_connection:adjust_window(Conn,Channel,Sz)
>
> > On 16 jan 2016, at 12:08, Rubén Caro <>
> wrote:
> >
> > 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}} ->
>
> ssh_connection:adjust_window(Conn,Channel,byte_size(Data))
>
> >      Loop(N + byte_size(Data))
> >  after
> >    5000 -> io:format("~p~n",[N])
> >  end
> > end.
> >
> > ssh_connection:exec(Conn, Channel, "yes", 5000).
> >
> > L(0).
>
> This will loop for a very long time
>
> /Tony
>
> > -----------------------------
> >
> > 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.
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160116/4fc64820/attachment.html>


More information about the erlang-questions mailing list