accept() public

Accepts an incoming connection. It returns a new UNIXSocket object.

UNIXServer.open("/tmp/sock") {|serv|
  UNIXSocket.open("/tmp/sock") {|c|
    s = serv.accept
    s.puts "hi"
    s.close
    p c.read #=> "hi\n"
  }
}
Show source
Register or log in to add new notes.