Flowdock
method

sysaccept

Importance_1
Ruby latest stable (v1_9_3_392) - 0 notes - Class: UNIXServer
sysaccept() public

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"
  }
}
Show source
Register or log in to add new notes.