るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.018秒)

別のキーワード

  1. shell/builtin-command new
  2. etc sc_shell
  3. shell/builtin-command each
  4. shell cd
  5. shell debug

クラス

検索結果

Socket.getservbyport(port, protocol_name="tcp") -> String (9.0)

ポート番号に対応するサービスの正式名を返します。

...す。

@param port ポート番号
@param protocol_name "tcp" や "udp" などのプロトコル名
@return サービスの正式名

require 'socket'

Socket
.getservbyport(80) #=> "www"
Socket
.getservbyport(514, "tcp") #=> "shell"
Socket
.getservbyport(514, "udp") #=> "syslog"...