sysaccept

unixserver.sysaccept => file_descriptor
Instance Public methods

Accepts a new connection. It returns the new file descriptor which is an integer.

UNIXServer.open("/tmp/sock") {|serv|
  UNIXSocket.open("/tmp/sock") {|c|
    fd = serv.sysaccept
    s = IO.new(fd)
    s.puts "hi"
    s.close
    p c.read #=> "hi\n"
  }
}
doc_ruby_on_rails
2015-06-10 00:53:01
Comments
Leave a Comment

Please login to continue.