Module: IO::Endpoint
- Defined in:
- lib/io/endpoint/version.rb,
lib/io/endpoint/wrapper.rb,
lib/io/endpoint/tls/openssl.rb,
lib/io/endpoint/ssl_endpoint.rb,
lib/io/endpoint/host_endpoint.rb,
lib/io/endpoint/unix_endpoint.rb,
lib/io/endpoint/bound_endpoint.rb,
lib/io/endpoint/named_endpoints.rb,
lib/io/endpoint/socket_endpoint.rb,
lib/io/endpoint/tls/trust_store.rb,
lib/io/endpoint/address_endpoint.rb,
lib/io/endpoint/tls/certificates.rb,
lib/io/endpoint/tls/configuration.rb,
lib/io/endpoint/composite_endpoint.rb,
lib/io/endpoint/connected_endpoint.rb,
lib/io/endpoint/generic.rb,
lib/io/endpoint.rb
Overview
Represents a collection of endpoint classes for network I/O operations.
Defined Under Namespace
Modules: TLS Classes: AddressEndpoint, BoundEndpoint, CompositeEndpoint, ConnectedEndpoint, Generic, HostEndpoint, NamedEndpoints, SSLEndpoint, SocketEndpoint, UNIXEndpoint, Wrapper
Constant Summary collapse
- VERSION =
"0.18.0"- Address =
Addrinfo
Class Method Summary collapse
-
.composite(*endpoints, **options) ⇒ Object
Create a composite endpoint from multiple endpoints.
-
.file_descriptor_limit ⇒ Object
Get the current file descriptor limit for the process.
-
.named(**endpoints) ⇒ Object
Create a named endpoints collection from keyword arguments.
-
.socket(socket, **options) ⇒ Object
Create a socket endpoint from an existing socket.
- .ssl(*arguments, ssl_context: nil, tls_configuration: nil, hostname: nil, **options) ⇒ Object
- .tcp(*arguments, **options) ⇒ Object
- .udp(*arguments, **options) ⇒ Object
- .unix(path = "", type = ::Socket::SOCK_STREAM, **options) ⇒ Object
Class Method Details
.composite(*endpoints, **options) ⇒ Object
Create a composite endpoint from multiple endpoints.
100 101 102 |
# File 'lib/io/endpoint/composite_endpoint.rb', line 100 def self.composite(*endpoints, **) CompositeEndpoint.new(endpoints, **) end |
.file_descriptor_limit ⇒ Object
Get the current file descriptor limit for the process.
17 18 19 |
# File 'lib/io/endpoint.rb', line 17 def self.file_descriptor_limit Process.getrlimit(Process::RLIMIT_NOFILE).first end |
.named(**endpoints) ⇒ Object
Create a named endpoints collection from keyword arguments.
89 90 91 |
# File 'lib/io/endpoint/named_endpoints.rb', line 89 def self.named(**endpoints) NamedEndpoints.new(endpoints) end |
.socket(socket, **options) ⇒ Object
Create a socket endpoint from an existing socket.
64 65 66 |
# File 'lib/io/endpoint/socket_endpoint.rb', line 64 def self.socket(socket, **) SocketEndpoint.new(socket, **) end |
.ssl(*arguments, ssl_context: nil, tls_configuration: nil, hostname: nil, **options) ⇒ Object
195 196 197 |
# File 'lib/io/endpoint/ssl_endpoint.rb', line 195 def self.ssl(*arguments, ssl_context: nil, tls_configuration: nil, hostname: nil, **) SSLEndpoint.new(self.tcp(*arguments, **), ssl_context: ssl_context, tls_configuration: tls_configuration, hostname: hostname) end |
.tcp(*arguments, **options) ⇒ Object
102 103 104 105 106 |
# File 'lib/io/endpoint/host_endpoint.rb', line 102 def self.tcp(*arguments, **) arguments[3] = ::Socket::SOCK_STREAM HostEndpoint.new(arguments, **) end |
.udp(*arguments, **options) ⇒ Object
112 113 114 115 116 |
# File 'lib/io/endpoint/host_endpoint.rb', line 112 def self.udp(*arguments, **) arguments[3] = ::Socket::SOCK_DGRAM HostEndpoint.new(arguments, **) end |
.unix(path = "", type = ::Socket::SOCK_STREAM, **options) ⇒ Object
156 157 158 |
# File 'lib/io/endpoint/unix_endpoint.rb', line 156 def self.unix(path = "", type = ::Socket::SOCK_STREAM, **) UNIXEndpoint.new(path, type, **) end |