Method: Net::SSH::Connection::Channel#send_data
- Defined in:
- lib/net/ssh/connection/channel.rb
#send_data(data) ⇒ Object
Sends data to the channel’s remote endpoint. This usually has the effect of sending the given string to the remote process’ stdin stream. Note that it does not immediately send the data across the channel, but instead merely appends the given data to the channel’s output buffer, preparatory to being packaged up and sent out the next time the connection is accepting data. (A connection might not be accepting data if, for instance, it has filled its data window and has not yet been resized by the remote end-point.)
This will raise an exception if the channel has previously declared that no more data will be sent (see #eof!).
channel.send_data("the password\n")
249 250 251 252 |
# File 'lib/net/ssh/connection/channel.rb', line 249 def send_data(data) raise EOFError, "cannot send data if channel has declared eof" if eof? output.append(data.to_s) end |