本文简要介绍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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
