本文簡要介紹ruby語言中  UNIXSocket.recv_io  的用法。
用法
recv_io([klass [, mode]]) → io示例
UNIXServer.open("/tmp/sock") {|serv|
  UNIXSocket.open("/tmp/sock") {|c|
    s = serv.accept
    c.send_io STDOUT
    stdout = s.recv_io
    p STDOUT.fileno #=> 1
    p stdout.fileno #=> 7
    stdout.puts "hello" # outputs "hello\n" to standard output.
  }
}klass 將確定返回的io 的類(使用 IO.for_fd  單例方法或類似方法)。如果 klass 是 nil ,則返回一個整數文件說明符。
mode 與傳遞給  IO.for_fd  的參數相同
相關用法
- Ruby UNIXSocket.recvfrom用法及代碼示例
- Ruby UNIXSocket.new用法及代碼示例
- Ruby UNIXSocket.addr用法及代碼示例
- Ruby UNIXSocket.peeraddr用法及代碼示例
- Ruby UNIXSocket.send_io用法及代碼示例
- Ruby UNIXSocket.pair用法及代碼示例
- Ruby UNIXSocket.path用法及代碼示例
- Ruby UNIXServer.accept用法及代碼示例
- Ruby UNIXServer.new用法及代碼示例
- Ruby UNIXServer.accept_nonblock用法及代碼示例
- Ruby UNIXServer.listen用法及代碼示例
- Ruby UNIXServer.sysaccept用法及代碼示例
- Ruby UndefinedConversionError.source_encoding用法及代碼示例
- Ruby UnboundMethod.original_name用法及代碼示例
- Ruby URI.parse用法及代碼示例
- Ruby UID.change_privilege用法及代碼示例
- Ruby Util.unescape用法及代碼示例
- Ruby Util.url_encode用法及代碼示例
- Ruby UnboundMethod.bind用法及代碼示例
- Ruby URI模塊用法及代碼示例
- Ruby UID.euid用法及代碼示例
- Ruby UncaughtThrowError類用法及代碼示例
- Ruby Util.pretty用法及代碼示例
- Ruby UID.uid用法及代碼示例
- Ruby UnwindDetails.all_requirements用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 UNIXSocket.recv_io。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
