Module: IO::Endpoint
- Defined in:
- lib/io/endpoint/version.rb,
lib/io/endpoint/wrapper.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/socket_endpoint.rb,
lib/io/endpoint/address_endpoint.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
Classes: AddressEndpoint, BoundEndpoint, CompositeEndpoint, ConnectedEndpoint, Generic, HostEndpoint, SSLEndpoint, SocketEndpoint, UNIXEndpoint, Wrapper
Constant Summary collapse
- VERSION =
"0.16.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.
-
.socket(socket, **options) ⇒ Object
Create a socket endpoint from an existing socket.
- .ssl(*arguments, ssl_context: 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.
14 15 16 |
# File 'lib/io/endpoint.rb', line 14 def self.file_descriptor_limit Process.getrlimit(Process::RLIMIT_NOFILE).first 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, hostname: nil, **options) ⇒ Object
253 254 255 |
# File 'lib/io/endpoint/ssl_endpoint.rb', line 253 def self.ssl(*arguments, ssl_context: nil, hostname: nil, **) SSLEndpoint.new(self.tcp(*arguments, **), ssl_context: ssl_context, hostname: hostname) end |
.tcp(*arguments, **options) ⇒ Object
103 104 105 106 107 |
# File 'lib/io/endpoint/host_endpoint.rb', line 103 def self.tcp(*arguments, **) arguments[3] = ::Socket::SOCK_STREAM HostEndpoint.new(arguments, **) end |
.udp(*arguments, **options) ⇒ Object
113 114 115 116 117 |
# File 'lib/io/endpoint/host_endpoint.rb', line 113 def self.udp(*arguments, **) arguments[3] = ::Socket::SOCK_DGRAM HostEndpoint.new(arguments, **) end |
.unix(path = "", type = ::Socket::SOCK_STREAM, **options) ⇒ Object
72 73 74 |
# File 'lib/io/endpoint/unix_endpoint.rb', line 72 def self.unix(path = "", type = ::Socket::SOCK_STREAM, **) UNIXEndpoint.new(path, type, **) end |