Flowdock
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.