るりまサーチ

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.073秒)
トップページ > クエリ:-[x] > クエリ:net/telnet[x] > 種類:クラス[x]

別のキーワード

  1. net/smtp start
  2. net/http get
  3. net/imap name
  4. net/imap param
  5. net/pop pop

ライブラリ

検索結果

Net::Telnet (8019.0)

このクラスは telnet のクライアント機能を提供します。

...グインしてコマンドを送る例、リモートホストから返ってきた文字列は
すべて標準出力に表示する
require 'net/telnet'

# リモートホスト "foobar" に接続
# タイムアウトは 10 秒
localhost = Net::Telnet.new("Host" => "localhost",...
...ち合わせる
telnet.cmd("ls") {|c| print c}

# sleep で 5 秒
telnet.cmd("sleep 5 && echo foobar &") {|c| print c}

STDOUT.flush # <- これがないとここまで処理が来てることがわかりにくい

# 前のコマンドの出力を待ち合わせる
telnet.waitfor(/...
...る。リモートホストからきた文字列は
すべて標準出力に表示
require 'net/telnet'

# リモートホスト(POPサーバ) "foobar" に接続
# ポート番号は110(POPのwell-knownポート)、
# "Telnetmode" は off (telnet用の特殊なバイト列を解釈しない)...