Class: Utils::UNIXServerExt Private

Inherits:
Socket
  • Object
show all
Extended by:
T::Generic
Defined in:
utils/socket.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Wrapper around UNIXServer to allow > 104 characters on macOS.

Constant Summary collapse

Elem =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

type_member(:out) { { fixed: String } }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ void

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.

Parameters:



41
42
43
44
45
46
# File 'utils/socket.rb', line 41

def initialize(path)
  super(:UNIX, :STREAM)
  bind(UNIXSocketExt.sockaddr_un(path))
  listen(Socket::SOMAXCONN)
  @path = path
end

Instance Attribute Details

#pathString (readonly)

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.

Returns:



38
39
40
# File 'utils/socket.rb', line 38

def path
  @path
end

Instance Method Details

#accept_nonblockUNIXSocket

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.

Returns:

  • (UNIXSocket)


49
50
51
52
53
# File 'utils/socket.rb', line 49

def accept_nonblock
  socket, = super
  socket.autoclose = false # Transfer autoclose responsibility to UNIXSocket
  UNIXSocket.for_fd(socket.fileno)
end