module Endpoint
Nested
Definitions
def self.composite(*endpoints, **options)
Create a composite endpoint from multiple endpoints.
Signature
-
parameter
endpointsArray(Generic) The endpoints to compose.
-
parameter
optionsHash Additional options to pass to the composite endpoint.
-
returns
CompositeEndpoint A new composite endpoint instance.
Implementation
def self.composite(*endpoints, **options)
CompositeEndpoint.new(endpoints, **options)
end
def self.tcp(*arguments, **options)
Signature
-
returns
HostEndpoint
Implementation
def self.tcp(*arguments, **options)
arguments[3] = ::Socket::SOCK_STREAM
HostEndpoint.new(arguments, **options)
end
def self.udp(*arguments, **options)
Signature
-
returns
HostEndpoint
Implementation
def self.udp(*arguments, **options)
arguments[3] = ::Socket::SOCK_DGRAM
HostEndpoint.new(arguments, **options)
end
def self.socket(socket, **options)
Create a socket endpoint from an existing socket.
Signature
-
parameter
socketSocket The socket to wrap.
-
parameter
optionsHash Additional options to pass to the socket endpoint.
-
returns
SocketEndpoint A new socket endpoint instance.
Implementation
def self.socket(socket, **options)
SocketEndpoint.new(socket, **options)
end
def self.ssl(*arguments, ssl_context: nil, hostname: nil, **options)
Signature
-
parameter
ssl_contextOpenSSL::SSL::SSLContext, nil -
parameter
hostnameString, nil -
returns
SSLEndpoint
Implementation
def self.ssl(*arguments, ssl_context: nil, hostname: nil, **options)
SSLEndpoint.new(self.tcp(*arguments, **options), ssl_context: ssl_context, hostname: hostname)
end
def self.unix(path = "", type = ::Socket::SOCK_STREAM, **options)
Signature
-
parameter
pathString -
returns
UNIXEndpoint
Implementation
def self.unix(path = "", type = ::Socket::SOCK_STREAM, **options)
UNIXEndpoint.new(path, type, **options)
end
def self.file_descriptor_limit
Get the current file descriptor limit for the process.
Signature
-
returns
Integer The soft limit for the number of open file descriptors.
Implementation
def self.file_descriptor_limit
Process.getrlimit(Process::RLIMIT_NOFILE).first
end