unix_server_socket(path)
Class Public methods
creates a UNIX server socket on path
If no block given, it returns a listening socket.
If a block is given, it is called with the socket and the block value is returned. When the block exits, the socket is closed and the socket file is removed.
1 2 3 4 5 6 7 8 | socket = Socket.unix_server_socket( "/tmp/s" ) p socket #=> #<Socket:fd 3> p socket.local_address #=> #<Addrinfo: /tmp/s SOCK_STREAM> Socket.unix_server_socket( "/tmp/sock" ) {|s| p s #=> #<Socket:fd 3> p s.local_address #=> # #<Addrinfo: /tmp/sock SOCK_STREAM> } |
Please login to continue.