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

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, **options)
	CompositeEndpoint.new(endpoints, **options)
end

.file_descriptor_limitObject

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, **options)
	SocketEndpoint.new(socket, **options)
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, **options)
	SSLEndpoint.new(self.tcp(*arguments, **options), 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, **options)
	arguments[3] = ::Socket::SOCK_STREAM
	
	HostEndpoint.new(arguments, **options)
end

.udp(*arguments, **options) ⇒ Object



113
114
115
116
117
# File 'lib/io/endpoint/host_endpoint.rb', line 113

def self.udp(*arguments, **options)
	arguments[3] = ::Socket::SOCK_DGRAM
	
	HostEndpoint.new(arguments, **options)
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, **options)
	UNIXEndpoint.new(path, type, **options)
end