[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Buffering issue when echoing user input


Hey Guys,

Back with a few more questions. I've got the client connected, with a PTY
and a shell opened. I can read on the channel and see what the user types,
and I can write to the channel and have it displayed in the client. However:

- Writes to the client seem to be buffered or somehow delayed until I read
from the client. If I echo back user input, they only receive my response
after a second keypress. For example, if the user types 'abc', they'll see
'ab'. If they then press enter, they'll get the c as well. With logging on
it looks like the data has been written, but I noticed that the code to
flush the socket doesn't have any logging, so I suppose it might be hung up
there.

- Is there a non-callback way to handle protocol messages once I've got a
channel open? I'm using a vanilla select() on the client socket, so it
fires even when non-channel data comes in - for example, if the client
resizes the PTY. Is there a way I can read the data into a buffer, and use
libssh to determine whether it's a protocol message or just input on the
channel?

Thanks,
Alan

-- 


--




Follow-Ups:
Re: Buffering issue when echoing user inputAlan Gardner <gardner@xxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org