Module: Utils::UNIXSocketExt Private
- Extended by:
- T::Generic
- Defined in:
- utils/socket.rb
Overview
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Wrapper around UNIXSocket to allow > 104 characters on macOS.
Class Method Summary collapse
- .open(path, &_block) {|unix_socket| ... } ⇒ T.type_parameter(:U) private
- .sockaddr_un(path) ⇒ String private
Class Method Details
.open(path, &_block) {|unix_socket| ... } ⇒ T.type_parameter(:U)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
17 18 19 20 21 22 23 |
# File 'utils/socket.rb', line 17 def self.open(path, &_block) socket = Socket.new(:UNIX, :STREAM) socket.connect(sockaddr_un(path)) unix_socket = UNIXSocket.for_fd(socket.fileno) socket.autoclose = false # Transfer autoclose responsibility to UNIXSocket yield unix_socket end |
.sockaddr_un(path) ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
26 27 28 |
# File 'utils/socket.rb', line 26 def self.sockaddr_un(path) Socket.sockaddr_un(path) end |