Flowdock
method

unix

Importance_1
v1_9_2_180 - Show latest stable - 0 notes - Class: Socket
unix(path) public

creates a new socket connected to path using UNIX socket socket.

If a block is given, the block is called with the socket. The value of the block is returned. The socket is closed when this method returns.

If no block is given, the socket is returned.

# talk to /tmp/sock socket.
Socket.unix("/tmp/sock") {|sock|
  t = Thread.new { IO.copy_stream(sock, STDOUT) }
  IO.copy_stream(STDIN, sock)
  t.join
}
Show source
Register or log in to add new notes.