e621stream 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +35 -0
- data/lib/e621stream/client/options.rb +20 -0
- data/lib/e621stream/client.rb +211 -0
- data/lib/e621stream/close_codes.rb +23 -0
- data/lib/e621stream/event.rb +24 -0
- data/lib/e621stream/events.rb +29 -0
- data/lib/e621stream/stream_error.rb +18 -0
- data/lib/e621stream/version.rb +5 -0
- data/lib/e621stream.rb +18 -0
- data/sorbet/config +6 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/minitest.rbi +120 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
- data/sorbet/rbi/gems/async-http@0.105.0.rbi +1649 -0
- data/sorbet/rbi/gems/async-pool@0.12.0.rbi +219 -0
- data/sorbet/rbi/gems/async-websocket@0.30.2.rbi +271 -0
- data/sorbet/rbi/gems/async@2.46.0.rbi +2193 -0
- data/sorbet/rbi/gems/benchmark@0.5.0.rbi +495 -0
- data/sorbet/rbi/gems/console@1.38.0.rbi +1552 -0
- data/sorbet/rbi/gems/erb@6.0.7.rbi +1581 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +153 -0
- data/sorbet/rbi/gems/fiber-annotation@0.2.0.rbi +62 -0
- data/sorbet/rbi/gems/fiber-local@1.1.0.rbi +36 -0
- data/sorbet/rbi/gems/fiber-storage@1.0.1.rbi +43 -0
- data/sorbet/rbi/gems/io-console@0.9.5.rbi +9 -0
- data/sorbet/rbi/gems/io-endpoint@0.19.0.rbi +1079 -0
- data/sorbet/rbi/gems/io-event@1.22.3.rbi +971 -0
- data/sorbet/rbi/gems/io-stream@0.14.0.rbi +805 -0
- data/sorbet/rbi/gems/json@3.1.0.rbi +1929 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.6.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
- data/sorbet/rbi/gems/minitest@5.27.0.rbi +1499 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
- data/sorbet/rbi/gems/openssl@4.0.2.rbi +4366 -0
- data/sorbet/rbi/gems/parallel@2.3.0.rbi +332 -0
- data/sorbet/rbi/gems/parser@3.3.13.0.rbi +5146 -0
- data/sorbet/rbi/gems/pp@0.6.4.rbi +373 -0
- data/sorbet/rbi/gems/prettyprint@0.2.1.rbi +476 -0
- data/sorbet/rbi/gems/prism@1.9.0.rbi +42213 -0
- data/sorbet/rbi/gems/protocol-hpack@1.5.1.rbi +418 -0
- data/sorbet/rbi/gems/protocol-http1@0.41.1.rbi +894 -0
- data/sorbet/rbi/gems/protocol-http2@0.29.2.rbi +2277 -0
- data/sorbet/rbi/gems/protocol-http@0.72.1.rbi +3801 -0
- data/sorbet/rbi/gems/protocol-rack@0.23.0.rbi +9 -0
- data/sorbet/rbi/gems/protocol-url@0.19.0.rbi +9 -0
- data/sorbet/rbi/gems/protocol-websocket@0.21.3.rbi +1087 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +169 -0
- data/sorbet/rbi/gems/rack@3.2.8.rbi +9 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
- data/sorbet/rbi/gems/rake@13.4.2.rbi +3127 -0
- data/sorbet/rbi/gems/rbi@0.5.0.rbi +5875 -0
- data/sorbet/rbi/gems/rbs@4.2.0.rbi +7133 -0
- data/sorbet/rbi/gems/rdoc@8.1.0.rbi +9 -0
- data/sorbet/rbi/gems/regexp_parser@2.13.1.rbi +3500 -0
- data/sorbet/rbi/gems/reline@0.7.0.rbi +2449 -0
- data/sorbet/rbi/gems/require-hooks@0.5.1.rbi +152 -0
- data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
- data/sorbet/rbi/gems/rubocop-ast@1.51.0.rbi +7230 -0
- data/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi +314 -0
- data/sorbet/rbi/gems/rubocop@1.92.2.rbi +69094 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
- data/sorbet/rbi/gems/rubydex@0.4.4.rbi +1620 -0
- data/sorbet/rbi/gems/spoom@1.8.13.rbi +7380 -0
- data/sorbet/rbi/gems/tapioca@0.20.0.rbi +3752 -0
- data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
- data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
- data/sorbet/rbi/gems/unicode-display_width@3.3.0.rbi +130 -0
- data/sorbet/rbi/gems/unicode-emoji@4.3.0.rbi +254 -0
- data/sorbet/rbi/gems/zeitwerk@2.8.3.rbi +1178 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +175 -0
|
@@ -0,0 +1,1079 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This is an autogenerated file for types exported from the `io-endpoint` gem.
|
|
5
|
+
# Please instead update this file by running `bin/tapioca gem io-endpoint`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# @namespace
|
|
9
|
+
#
|
|
10
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/version.rb:7
|
|
11
|
+
class IO
|
|
12
|
+
include ::Enumerable
|
|
13
|
+
include ::File::Constants
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class IO::Buffer
|
|
17
|
+
include ::Comparable
|
|
18
|
+
|
|
19
|
+
def initialize(*_arg0); end
|
|
20
|
+
|
|
21
|
+
def &(_arg0); end
|
|
22
|
+
def <=>(_arg0); end
|
|
23
|
+
def ^(_arg0); end
|
|
24
|
+
def and!(_arg0); end
|
|
25
|
+
def clear(*_arg0); end
|
|
26
|
+
def copy(*_arg0); end
|
|
27
|
+
def each(*_arg0); end
|
|
28
|
+
def each_byte(*_arg0); end
|
|
29
|
+
def empty?; end
|
|
30
|
+
def external?; end
|
|
31
|
+
def free; end
|
|
32
|
+
def get_string(*_arg0); end
|
|
33
|
+
def get_value(_arg0, _arg1); end
|
|
34
|
+
def get_values(_arg0, _arg1); end
|
|
35
|
+
def hexdump(*_arg0); end
|
|
36
|
+
def inspect; end
|
|
37
|
+
def internal?; end
|
|
38
|
+
def locked; end
|
|
39
|
+
def locked?; end
|
|
40
|
+
def mapped?; end
|
|
41
|
+
def not!; end
|
|
42
|
+
def null?; end
|
|
43
|
+
def or!(_arg0); end
|
|
44
|
+
def pread(*_arg0); end
|
|
45
|
+
def private?; end
|
|
46
|
+
def pwrite(*_arg0); end
|
|
47
|
+
def read(*_arg0); end
|
|
48
|
+
def readonly?; end
|
|
49
|
+
def resize(_arg0); end
|
|
50
|
+
def set_string(*_arg0); end
|
|
51
|
+
def set_value(_arg0, _arg1, _arg2); end
|
|
52
|
+
def set_values(_arg0, _arg1, _arg2); end
|
|
53
|
+
def shared?; end
|
|
54
|
+
def size; end
|
|
55
|
+
def slice(*_arg0); end
|
|
56
|
+
def to_s; end
|
|
57
|
+
def transfer; end
|
|
58
|
+
def valid?; end
|
|
59
|
+
def values(*_arg0); end
|
|
60
|
+
def write(*_arg0); end
|
|
61
|
+
def xor!(_arg0); end
|
|
62
|
+
def |(_arg0); end
|
|
63
|
+
def ~; end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
|
|
67
|
+
def initialize_copy(_arg0); end
|
|
68
|
+
|
|
69
|
+
class << self
|
|
70
|
+
def for(_arg0); end
|
|
71
|
+
def map(*_arg0); end
|
|
72
|
+
def size_of(_arg0); end
|
|
73
|
+
def string(_arg0); end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
class IO::Buffer::AccessError < ::RuntimeError; end
|
|
78
|
+
class IO::Buffer::AllocationError < ::RuntimeError; end
|
|
79
|
+
IO::Buffer::BIG_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
80
|
+
IO::Buffer::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer)
|
|
81
|
+
IO::Buffer::EXTERNAL = T.let(T.unsafe(nil), Integer)
|
|
82
|
+
IO::Buffer::HOST_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
83
|
+
IO::Buffer::INTERNAL = T.let(T.unsafe(nil), Integer)
|
|
84
|
+
class IO::Buffer::InvalidatedError < ::RuntimeError; end
|
|
85
|
+
IO::Buffer::LITTLE_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
86
|
+
IO::Buffer::LOCKED = T.let(T.unsafe(nil), Integer)
|
|
87
|
+
class IO::Buffer::LockedError < ::RuntimeError; end
|
|
88
|
+
IO::Buffer::MAPPED = T.let(T.unsafe(nil), Integer)
|
|
89
|
+
class IO::Buffer::MaskError < ::ArgumentError; end
|
|
90
|
+
IO::Buffer::NETWORK_ENDIAN = T.let(T.unsafe(nil), Integer)
|
|
91
|
+
IO::Buffer::PAGE_SIZE = T.let(T.unsafe(nil), Integer)
|
|
92
|
+
IO::Buffer::PRIVATE = T.let(T.unsafe(nil), Integer)
|
|
93
|
+
IO::Buffer::READONLY = T.let(T.unsafe(nil), Integer)
|
|
94
|
+
IO::Buffer::SHARED = T.let(T.unsafe(nil), Integer)
|
|
95
|
+
|
|
96
|
+
class IO::EAGAINWaitReadable < ::Errno::EAGAIN
|
|
97
|
+
include ::IO::WaitReadable
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
class IO::EAGAINWaitWritable < ::Errno::EAGAIN
|
|
101
|
+
include ::IO::WaitWritable
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
class IO::EINPROGRESSWaitReadable < ::Errno::EINPROGRESS
|
|
105
|
+
include ::IO::WaitReadable
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
class IO::EINPROGRESSWaitWritable < ::Errno::EINPROGRESS
|
|
109
|
+
include ::IO::WaitWritable
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
IO::EWOULDBLOCKWaitReadable = IO::EAGAINWaitReadable
|
|
113
|
+
IO::EWOULDBLOCKWaitWritable = IO::EAGAINWaitWritable
|
|
114
|
+
|
|
115
|
+
# Represents a collection of endpoint classes for network I/O operations.
|
|
116
|
+
# Released under the MIT License.
|
|
117
|
+
# Copyright, 2026, by Samuel Williams.
|
|
118
|
+
# @namespace
|
|
119
|
+
#
|
|
120
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/version.rb:9
|
|
121
|
+
module IO::Endpoint
|
|
122
|
+
class << self
|
|
123
|
+
# Create a composite endpoint from multiple endpoints.
|
|
124
|
+
# @parameter endpoints [Array(Generic)] The endpoints to compose.
|
|
125
|
+
# @parameter options [Hash] Additional options to pass to the composite endpoint.
|
|
126
|
+
# @returns [CompositeEndpoint] A new composite endpoint instance.
|
|
127
|
+
#
|
|
128
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:100
|
|
129
|
+
def composite(*endpoints, **options); end
|
|
130
|
+
|
|
131
|
+
# Get the current file descriptor limit for the process.
|
|
132
|
+
# @returns [Integer] The soft limit for the number of open file descriptors.
|
|
133
|
+
#
|
|
134
|
+
# pkg:gem/io-endpoint#lib/io/endpoint.rb:17
|
|
135
|
+
def file_descriptor_limit; end
|
|
136
|
+
|
|
137
|
+
# Create a socket endpoint from an existing socket.
|
|
138
|
+
# @parameter socket [Socket] The socket to wrap.
|
|
139
|
+
# @parameter options [Hash] Additional options to pass to the socket endpoint.
|
|
140
|
+
# @returns [SocketEndpoint] A new socket endpoint instance.
|
|
141
|
+
#
|
|
142
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:64
|
|
143
|
+
def socket(socket, **options); end
|
|
144
|
+
|
|
145
|
+
# @parameter arguments
|
|
146
|
+
# @parameter ssl_context [OpenSSL::SSL::SSLContext, nil]
|
|
147
|
+
# @parameter tls_configuration [TLS::Configuration, nil]
|
|
148
|
+
# @parameter hostname [String, nil]
|
|
149
|
+
# @parameter options keyword arguments passed through to {Endpoint.tcp}
|
|
150
|
+
#
|
|
151
|
+
# @returns [SSLEndpoint]
|
|
152
|
+
#
|
|
153
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:195
|
|
154
|
+
def ssl(*arguments, ssl_context: T.unsafe(nil), tls_configuration: T.unsafe(nil), hostname: T.unsafe(nil), **options); end
|
|
155
|
+
|
|
156
|
+
# @parameter arguments nodename, service, family, socktype, protocol, flags. `socktype` will be set to Socket::SOCK_STREAM.
|
|
157
|
+
# @parameter options keyword arguments passed on to {HostEndpoint#initialize}
|
|
158
|
+
#
|
|
159
|
+
# @returns [HostEndpoint]
|
|
160
|
+
#
|
|
161
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:102
|
|
162
|
+
def tcp(*arguments, **options); end
|
|
163
|
+
|
|
164
|
+
# @parameter arguments nodename, service, family, socktype, protocol, flags. `socktype` will be set to Socket::SOCK_DGRAM.
|
|
165
|
+
# @parameter options keyword arguments passed on to {HostEndpoint#initialize}
|
|
166
|
+
#
|
|
167
|
+
# @returns [HostEndpoint]
|
|
168
|
+
#
|
|
169
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:112
|
|
170
|
+
def udp(*arguments, **options); end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:11
|
|
175
|
+
IO::Endpoint::Address = Addrinfo
|
|
176
|
+
|
|
177
|
+
# Represents an endpoint for a specific network address.
|
|
178
|
+
#
|
|
179
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/address_endpoint.rb:13
|
|
180
|
+
class IO::Endpoint::AddressEndpoint < ::IO::Endpoint::Generic
|
|
181
|
+
# Initialize a new address endpoint.
|
|
182
|
+
# @parameter address [Address] The network address for this endpoint.
|
|
183
|
+
# @parameter options [Hash] Additional options to pass to the parent class.
|
|
184
|
+
#
|
|
185
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/address_endpoint.rb:17
|
|
186
|
+
def initialize(address, **options); end
|
|
187
|
+
|
|
188
|
+
# @attribute [Address] The network address for this endpoint.
|
|
189
|
+
#
|
|
190
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/address_endpoint.rb:45
|
|
191
|
+
def address; end
|
|
192
|
+
|
|
193
|
+
# Bind a socket to the given address. If a block is given, the socket will be automatically closed when the block exits.
|
|
194
|
+
# @yields {|socket| ...} If a block is given, yields the bound socket.
|
|
195
|
+
# @parameter socket [Socket] The socket which has been bound.
|
|
196
|
+
# @returns [Array(Socket)] the bound socket
|
|
197
|
+
#
|
|
198
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/address_endpoint.rb:51
|
|
199
|
+
def bind(wrapper = T.unsafe(nil), &block); end
|
|
200
|
+
|
|
201
|
+
# Connects a socket to the given address. If a block is given, the socket will be automatically closed when the block exits.
|
|
202
|
+
# @returns [Socket] the connected socket
|
|
203
|
+
#
|
|
204
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/address_endpoint.rb:57
|
|
205
|
+
def connect(wrapper = T.unsafe(nil), &block); end
|
|
206
|
+
|
|
207
|
+
# Get a detailed string representation of the endpoint.
|
|
208
|
+
# @returns [String] A detailed string representation including the address.
|
|
209
|
+
#
|
|
210
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/address_endpoint.rb:40
|
|
211
|
+
def inspect; end
|
|
212
|
+
|
|
213
|
+
# Get a string representation of the endpoint.
|
|
214
|
+
# @returns [String] A string representation of the endpoint address.
|
|
215
|
+
#
|
|
216
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/address_endpoint.rb:25
|
|
217
|
+
def to_s; end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Represents an endpoint that has been bound to one or more sockets.
|
|
221
|
+
#
|
|
222
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:12
|
|
223
|
+
class IO::Endpoint::BoundEndpoint < ::IO::Endpoint::Generic
|
|
224
|
+
# Initialize a new bound endpoint.
|
|
225
|
+
# @parameter endpoint [Generic] The original endpoint that was bound.
|
|
226
|
+
# @parameter sockets [Array(Socket)] The sockets that were bound.
|
|
227
|
+
# @parameter options [Hash] Additional options to pass to the parent class.
|
|
228
|
+
#
|
|
229
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:32
|
|
230
|
+
def initialize(endpoint, sockets, **options); end
|
|
231
|
+
|
|
232
|
+
# Bind the endpoint using the given wrapper.
|
|
233
|
+
# @parameter wrapper [Wrapper] The wrapper to use for binding.
|
|
234
|
+
# @yields {|socket| ...} If a block is given, yields each bound socket.
|
|
235
|
+
# @parameter socket [Socket] A bound socket.
|
|
236
|
+
# @returns [Array(Socket)] An array of bound sockets.
|
|
237
|
+
#
|
|
238
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:87
|
|
239
|
+
def bind(wrapper = T.unsafe(nil), &block); end
|
|
240
|
+
|
|
241
|
+
# Close all bound sockets.
|
|
242
|
+
#
|
|
243
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:65
|
|
244
|
+
def close; end
|
|
245
|
+
|
|
246
|
+
# @attribute [Generic] The original endpoint that was bound.
|
|
247
|
+
#
|
|
248
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:40
|
|
249
|
+
def endpoint; end
|
|
250
|
+
|
|
251
|
+
# Get a detailed string representation of the bound endpoint.
|
|
252
|
+
# @returns [String] A detailed string representation including socket count.
|
|
253
|
+
#
|
|
254
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:78
|
|
255
|
+
def inspect; end
|
|
256
|
+
|
|
257
|
+
# A endpoint for the local end of the bound socket.
|
|
258
|
+
# @returns [CompositeEndpoint] A composite endpoint for the local end of the bound socket.
|
|
259
|
+
#
|
|
260
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:46
|
|
261
|
+
def local_address_endpoint(**options); end
|
|
262
|
+
|
|
263
|
+
# A endpoint for the remote end of the bound socket.
|
|
264
|
+
# @returns [CompositeEndpoint] A composite endpoint for the remote end of the bound socket.
|
|
265
|
+
#
|
|
266
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:56
|
|
267
|
+
def remote_address_endpoint(**options); end
|
|
268
|
+
|
|
269
|
+
# @attribute [Array(Socket)] The sockets that were bound.
|
|
270
|
+
#
|
|
271
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:42
|
|
272
|
+
def sockets; end
|
|
273
|
+
|
|
274
|
+
# Get a string representation of the bound endpoint.
|
|
275
|
+
# @returns [String] A string representation of the bound endpoint.
|
|
276
|
+
#
|
|
277
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:72
|
|
278
|
+
def to_s; end
|
|
279
|
+
|
|
280
|
+
class << self
|
|
281
|
+
# Create a bound endpoint from an existing endpoint.
|
|
282
|
+
# @parameter endpoint [Generic] The endpoint to bind.
|
|
283
|
+
# @option backlog [Integer] The maximum length of the queue of pending connections.
|
|
284
|
+
# @option close_on_exec [Boolean] Whether to close sockets on exec.
|
|
285
|
+
# @returns [BoundEndpoint] A new bound endpoint instance.
|
|
286
|
+
#
|
|
287
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:18
|
|
288
|
+
def bound(endpoint, backlog: T.unsafe(nil), close_on_exec: T.unsafe(nil)); end
|
|
289
|
+
end
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# A composite endpoint is a collection of endpoints that are used in order.
|
|
293
|
+
#
|
|
294
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:10
|
|
295
|
+
class IO::Endpoint::CompositeEndpoint < ::IO::Endpoint::Generic
|
|
296
|
+
# Initialize a new composite endpoint.
|
|
297
|
+
# @parameter endpoints [Array(Generic)] The endpoints to compose.
|
|
298
|
+
# @parameter options [Hash] Additional options to pass to the parent class and propagate to endpoints.
|
|
299
|
+
#
|
|
300
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:14
|
|
301
|
+
def initialize(endpoints, **options); end
|
|
302
|
+
|
|
303
|
+
# Bind all endpoints in the composite.
|
|
304
|
+
# @parameter wrapper [Wrapper] The wrapper to use for binding.
|
|
305
|
+
# @yields {|socket| ...} For each endpoint that is bound, yields the bound socket.
|
|
306
|
+
# @parameter socket [Socket] A bound socket.
|
|
307
|
+
# @returns [Array(Socket)] An array of bound sockets if no block is given.
|
|
308
|
+
#
|
|
309
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:85
|
|
310
|
+
def bind(wrapper = T.unsafe(nil), &block); end
|
|
311
|
+
|
|
312
|
+
# Connect to the first endpoint that succeeds.
|
|
313
|
+
# @parameter wrapper [Wrapper] The wrapper to use for connecting.
|
|
314
|
+
# @yields {|socket| ...} If a block is given, yields the connected socket from the first successful endpoint.
|
|
315
|
+
# @parameter socket [Socket] The connected socket.
|
|
316
|
+
# @returns [Socket] The connected socket.
|
|
317
|
+
# @raises [Exception] If all endpoints fail to connect, raises the last error encountered.
|
|
318
|
+
#
|
|
319
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:67
|
|
320
|
+
def connect(wrapper = T.unsafe(nil), &block); end
|
|
321
|
+
|
|
322
|
+
# Enumerate all endpoints in the composite endpoint.
|
|
323
|
+
# @yields {|endpoint| ...} For each endpoint in the composite, yields it.
|
|
324
|
+
# @parameter endpoint [Generic] An endpoint in the composite.
|
|
325
|
+
#
|
|
326
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:55
|
|
327
|
+
def each(&block); end
|
|
328
|
+
|
|
329
|
+
# @attribute [Array(Generic)] The endpoints in this composite endpoint.
|
|
330
|
+
#
|
|
331
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:45
|
|
332
|
+
def endpoints; end
|
|
333
|
+
|
|
334
|
+
# Get a detailed string representation of the composite endpoint.
|
|
335
|
+
# @returns [String] A detailed string representation including all endpoints.
|
|
336
|
+
#
|
|
337
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:33
|
|
338
|
+
def inspect; end
|
|
339
|
+
|
|
340
|
+
# The number of endpoints in the composite endpoint.
|
|
341
|
+
#
|
|
342
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:48
|
|
343
|
+
def size; end
|
|
344
|
+
|
|
345
|
+
# Get a string representation of the composite endpoint.
|
|
346
|
+
# @returns [String] A string representation listing all endpoints.
|
|
347
|
+
#
|
|
348
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:27
|
|
349
|
+
def to_s; end
|
|
350
|
+
|
|
351
|
+
# Create a new composite endpoint with merged options.
|
|
352
|
+
# @parameter options [Hash] Additional options to merge with existing options.
|
|
353
|
+
# @returns [CompositeEndpoint] A new composite endpoint instance with merged options.
|
|
354
|
+
#
|
|
355
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/composite_endpoint.rb:40
|
|
356
|
+
def with(**options); end
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# Represents an endpoint that has been connected to a socket.
|
|
360
|
+
#
|
|
361
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:14
|
|
362
|
+
class IO::Endpoint::ConnectedEndpoint < ::IO::Endpoint::Generic
|
|
363
|
+
# Initialize a new connected endpoint.
|
|
364
|
+
# @parameter endpoint [Generic] The original endpoint that was connected.
|
|
365
|
+
# @parameter socket [Socket] The socket that was connected.
|
|
366
|
+
# @parameter options [Hash] Additional options to pass to the parent class.
|
|
367
|
+
#
|
|
368
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:31
|
|
369
|
+
def initialize(endpoint, socket, **options); end
|
|
370
|
+
|
|
371
|
+
# Close the connected socket.
|
|
372
|
+
#
|
|
373
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:69
|
|
374
|
+
def close; end
|
|
375
|
+
|
|
376
|
+
# Connect using the already connected socket.
|
|
377
|
+
# @parameter wrapper [Wrapper] The wrapper to use (unused, socket is already connected).
|
|
378
|
+
# @yields {|socket| ...} If a block is given, yields the connected socket.
|
|
379
|
+
# @parameter socket [Socket] The connected socket.
|
|
380
|
+
# @returns [Socket] The connected socket or a duplicate if no block is given.
|
|
381
|
+
#
|
|
382
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:60
|
|
383
|
+
def connect(wrapper = T.unsafe(nil), &block); end
|
|
384
|
+
|
|
385
|
+
# @attribute [Generic] The original endpoint that was connected.
|
|
386
|
+
#
|
|
387
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:39
|
|
388
|
+
def endpoint; end
|
|
389
|
+
|
|
390
|
+
# Get a detailed string representation of the connected endpoint.
|
|
391
|
+
# @returns [String] A detailed string representation including the socket.
|
|
392
|
+
#
|
|
393
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:84
|
|
394
|
+
def inspect; end
|
|
395
|
+
|
|
396
|
+
# A endpoint for the local end of the bound socket.
|
|
397
|
+
# @returns [AddressEndpoint] A endpoint for the local end of the connected socket.
|
|
398
|
+
#
|
|
399
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:45
|
|
400
|
+
def local_address_endpoint(**options); end
|
|
401
|
+
|
|
402
|
+
# A endpoint for the remote end of the bound socket.
|
|
403
|
+
# @returns [AddressEndpoint] A endpoint for the remote end of the connected socket.
|
|
404
|
+
#
|
|
405
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:51
|
|
406
|
+
def remote_address_endpoint(**options); end
|
|
407
|
+
|
|
408
|
+
# @attribute [Socket] The socket that was connected.
|
|
409
|
+
#
|
|
410
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:41
|
|
411
|
+
def socket; end
|
|
412
|
+
|
|
413
|
+
# Get a string representation of the connected endpoint.
|
|
414
|
+
# @returns [String] A string representation of the connected endpoint.
|
|
415
|
+
#
|
|
416
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:78
|
|
417
|
+
def to_s; end
|
|
418
|
+
|
|
419
|
+
class << self
|
|
420
|
+
# Create a connected endpoint from an existing endpoint.
|
|
421
|
+
# @parameter endpoint [Generic] The endpoint to connect.
|
|
422
|
+
# @option close_on_exec [Boolean] Whether to close the socket on exec.
|
|
423
|
+
# @returns [ConnectedEndpoint] A new connected endpoint instance.
|
|
424
|
+
#
|
|
425
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:19
|
|
426
|
+
def connected(endpoint, close_on_exec: T.unsafe(nil)); end
|
|
427
|
+
end
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
# Endpoints represent a way of connecting or binding to an address.
|
|
431
|
+
#
|
|
432
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:14
|
|
433
|
+
class IO::Endpoint::Generic
|
|
434
|
+
# Initialize a new generic endpoint.
|
|
435
|
+
# @parameter options [Hash] Configuration options for the endpoint.
|
|
436
|
+
#
|
|
437
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:17
|
|
438
|
+
def initialize(**options); end
|
|
439
|
+
|
|
440
|
+
# Bind and accept connections on the given address.
|
|
441
|
+
# @parameter wrapper [Wrapper] The wrapper to use for accepting connections.
|
|
442
|
+
# @yields {|socket| ...} For each accepted connection, yields the socket.
|
|
443
|
+
# @parameter socket [Socket] The accepted socket.
|
|
444
|
+
#
|
|
445
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:87
|
|
446
|
+
def accept(wrapper = T.unsafe(nil), &block); end
|
|
447
|
+
|
|
448
|
+
# Bind a socket to the given address. If a block is given, the socket will be automatically closed when the block exits.
|
|
449
|
+
# @parameter wrapper [Wrapper] The wrapper to use for binding.
|
|
450
|
+
# @yields {|socket| ...} If a block is given, yields the bound socket.
|
|
451
|
+
# @parameter socket [Socket] The socket which has been bound.
|
|
452
|
+
# @returns [Array(Socket)] the bound socket
|
|
453
|
+
#
|
|
454
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:72
|
|
455
|
+
def bind(wrapper = T.unsafe(nil), &block); end
|
|
456
|
+
|
|
457
|
+
# Create a bound endpoint from this endpoint.
|
|
458
|
+
# @parameter options [Hash] Options to pass to {BoundEndpoint.bound}.
|
|
459
|
+
# @returns [BoundEndpoint] A new bound endpoint instance.
|
|
460
|
+
#
|
|
461
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/bound_endpoint.rb:104
|
|
462
|
+
def bound(**options); end
|
|
463
|
+
|
|
464
|
+
# Connects a socket to the given address. If a block is given, the socket will be automatically closed when the block exits.
|
|
465
|
+
# @parameter wrapper [Wrapper] The wrapper to use for connecting.
|
|
466
|
+
# @returns [Socket] the connected socket
|
|
467
|
+
#
|
|
468
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:79
|
|
469
|
+
def connect(wrapper = T.unsafe(nil), &block); end
|
|
470
|
+
|
|
471
|
+
# Create a connected endpoint from this endpoint.
|
|
472
|
+
# @parameter options [Hash] Options to pass to {ConnectedEndpoint.connected}.
|
|
473
|
+
# @returns [ConnectedEndpoint] A new connected endpoint instance.
|
|
474
|
+
#
|
|
475
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/connected_endpoint.rb:93
|
|
476
|
+
def connected(**options); end
|
|
477
|
+
|
|
478
|
+
# Enumerate all discrete paths as endpoints.
|
|
479
|
+
# @yields {|endpoint| ...} For each endpoint, yields it.
|
|
480
|
+
# @parameter endpoint [Endpoint] The endpoint.
|
|
481
|
+
#
|
|
482
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:96
|
|
483
|
+
def each; end
|
|
484
|
+
|
|
485
|
+
# @returns [String] The hostname of the bound socket.
|
|
486
|
+
#
|
|
487
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:35
|
|
488
|
+
def hostname; end
|
|
489
|
+
|
|
490
|
+
# Controls SO_LINGER. The amount of time the socket will stay in the `TIME_WAIT` state after being closed.
|
|
491
|
+
# @returns [Integer, nil] The value for SO_LINGER.
|
|
492
|
+
#
|
|
493
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:53
|
|
494
|
+
def linger; end
|
|
495
|
+
|
|
496
|
+
# @returns [Address] the address to bind to before connecting.
|
|
497
|
+
#
|
|
498
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:63
|
|
499
|
+
def local_address; end
|
|
500
|
+
|
|
501
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:32
|
|
502
|
+
def options; end
|
|
503
|
+
|
|
504
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:32
|
|
505
|
+
def options=(_arg0); end
|
|
506
|
+
|
|
507
|
+
# If `SO_REUSEADDR` is enabled on a socket prior to binding it, the socket can be successfully bound unless there is a conflict with another socket bound to exactly the same combination of source address and port. Additionally, when set, binding a socket to the address of an existing socket in `TIME_WAIT` is not an error.
|
|
508
|
+
# @returns [Boolean] The value for `SO_REUSEADDR`.
|
|
509
|
+
#
|
|
510
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:47
|
|
511
|
+
def reuse_address?; end
|
|
512
|
+
|
|
513
|
+
# If `SO_REUSEPORT` is enabled on a socket, the socket can be successfully bound even if there are existing sockets bound to the same address, as long as all prior bound sockets also had `SO_REUSEPORT` set before they were bound.
|
|
514
|
+
# @returns [Boolean, nil] The value for `SO_REUSEPORT`.
|
|
515
|
+
#
|
|
516
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:41
|
|
517
|
+
def reuse_port?; end
|
|
518
|
+
|
|
519
|
+
# @returns [Numeric] The default timeout for socket operations.
|
|
520
|
+
#
|
|
521
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:58
|
|
522
|
+
def timeout; end
|
|
523
|
+
|
|
524
|
+
# Create a new endpoint with merged options.
|
|
525
|
+
# @parameter options [Hash] Additional options to merge with existing options.
|
|
526
|
+
# @returns [Generic] A new endpoint instance with merged options.
|
|
527
|
+
#
|
|
528
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:24
|
|
529
|
+
def with(**options); end
|
|
530
|
+
|
|
531
|
+
# The default wrapper to use for binding, connecting, and accepting connections.
|
|
532
|
+
#
|
|
533
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:120
|
|
534
|
+
def wrapper; end
|
|
535
|
+
|
|
536
|
+
class << self
|
|
537
|
+
# Create an Endpoint instance by URI scheme. The host and port of the URI will be passed to the Endpoint factory method, along with any options.
|
|
538
|
+
#
|
|
539
|
+
# You should not use untrusted input as it may execute arbitrary code.
|
|
540
|
+
#
|
|
541
|
+
# @parameter string [String] URI as string. Scheme will decide implementation used.
|
|
542
|
+
# @parameter options keyword arguments passed through to {#initialize}
|
|
543
|
+
#
|
|
544
|
+
# @see Endpoint.ssl ssl - invoked when parsing a URL with the ssl scheme "ssl://127.0.0.1"
|
|
545
|
+
# @see Endpoint.tcp tcp - invoked when parsing a URL with the tcp scheme: "tcp://127.0.0.1"
|
|
546
|
+
# @see Endpoint.udp udp - invoked when parsing a URL with the udp scheme: "udp://127.0.0.1"
|
|
547
|
+
# @see Endpoint.unix unix - invoked when parsing a URL with the unix scheme: "unix://127.0.0.1"
|
|
548
|
+
#
|
|
549
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/generic.rb:113
|
|
550
|
+
def parse(string, **options); end
|
|
551
|
+
end
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
# Represents an endpoint for a hostname and service that resolves to multiple addresses.
|
|
555
|
+
#
|
|
556
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:10
|
|
557
|
+
class IO::Endpoint::HostEndpoint < ::IO::Endpoint::Generic
|
|
558
|
+
# Initialize a new host endpoint.
|
|
559
|
+
# @parameter specification [Array] The host specification array containing nodename, service, family, socktype, protocol, and flags.
|
|
560
|
+
# @parameter options [Hash] Additional options to pass to the parent class.
|
|
561
|
+
#
|
|
562
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:14
|
|
563
|
+
def initialize(specification, **options); end
|
|
564
|
+
|
|
565
|
+
# Invokes the given block for every address which can be bound to.
|
|
566
|
+
# @yields {|socket| ...} For each address that can be bound, yields the bound socket.
|
|
567
|
+
# @parameter socket [Socket] The bound socket.
|
|
568
|
+
# @returns [Array<Socket>] an array of bound sockets
|
|
569
|
+
#
|
|
570
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:81
|
|
571
|
+
def bind(wrapper = T.unsafe(nil), &block); end
|
|
572
|
+
|
|
573
|
+
# Try to connect to the given host by connecting to each address in sequence until a connection is made.
|
|
574
|
+
# @yields {|socket| ...} If a block is given, yields the connected socket (may be invoked multiple times during connection attempts).
|
|
575
|
+
# @parameter socket [Socket] The socket which is being connected.
|
|
576
|
+
# @returns [Socket] the connected socket
|
|
577
|
+
# @raises [Exception] if no connection could complete successfully
|
|
578
|
+
#
|
|
579
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:54
|
|
580
|
+
def connect(wrapper = T.unsafe(nil), &block); end
|
|
581
|
+
|
|
582
|
+
# @yields {|endpoint| ...} For each resolved address, yields an address endpoint.
|
|
583
|
+
# @parameter endpoint [AddressEndpoint] An address endpoint.
|
|
584
|
+
#
|
|
585
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:89
|
|
586
|
+
def each; end
|
|
587
|
+
|
|
588
|
+
# Get the hostname from the specification.
|
|
589
|
+
# @returns [String, nil] The hostname (nodename) from the specification.
|
|
590
|
+
#
|
|
591
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:39
|
|
592
|
+
def hostname; end
|
|
593
|
+
|
|
594
|
+
# Get a detailed string representation of the host endpoint.
|
|
595
|
+
# @returns [String] A detailed string representation including all specification parameters.
|
|
596
|
+
#
|
|
597
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:28
|
|
598
|
+
def inspect; end
|
|
599
|
+
|
|
600
|
+
# Get the service from the specification.
|
|
601
|
+
# @returns [String, Integer, nil] The service (port) from the specification.
|
|
602
|
+
#
|
|
603
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:45
|
|
604
|
+
def service; end
|
|
605
|
+
|
|
606
|
+
# @attribute [Array] The host specification array.
|
|
607
|
+
#
|
|
608
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:35
|
|
609
|
+
def specification; end
|
|
610
|
+
|
|
611
|
+
# Get a string representation of the host endpoint.
|
|
612
|
+
# @returns [String] A string representation showing hostname and service.
|
|
613
|
+
#
|
|
614
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/host_endpoint.rb:22
|
|
615
|
+
def to_s; end
|
|
616
|
+
end
|
|
617
|
+
|
|
618
|
+
# Represents an SSL/TLS endpoint that wraps another endpoint.
|
|
619
|
+
#
|
|
620
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:31
|
|
621
|
+
class IO::Endpoint::SSLEndpoint < ::IO::Endpoint::Generic
|
|
622
|
+
# Initialize a new SSL endpoint.
|
|
623
|
+
# @parameter endpoint [Generic] The underlying endpoint to wrap with SSL.
|
|
624
|
+
# @option ssl_context [OpenSSL::SSL::SSLContext, nil] An optional SSL context to use.
|
|
625
|
+
# @option tls_configuration [TLS::Configuration, nil] Transport-neutral TLS certificate and verification configuration.
|
|
626
|
+
# @parameter options [Hash] Additional options including `:ssl_params` and `:hostname`.
|
|
627
|
+
#
|
|
628
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:37
|
|
629
|
+
def initialize(endpoint, **options); end
|
|
630
|
+
|
|
631
|
+
# Get the address from the underlying endpoint.
|
|
632
|
+
# @returns [Address, nil] The address from the underlying endpoint.
|
|
633
|
+
#
|
|
634
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:63
|
|
635
|
+
def address; end
|
|
636
|
+
|
|
637
|
+
# Connect to the underlying endpoint and establish a SSL connection.
|
|
638
|
+
# @yields {|socket| ...} If a block is given, yields the SSL server socket.
|
|
639
|
+
# @parameter socket [Socket] The SSL server socket.
|
|
640
|
+
# @returns [Socket] the connected socket
|
|
641
|
+
#
|
|
642
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:137
|
|
643
|
+
def bind(*arguments, **options, &block); end
|
|
644
|
+
|
|
645
|
+
# Build an SSL context with configured parameters.
|
|
646
|
+
# @parameter context [OpenSSL::SSL::SSLContext] An optional SSL context to configure.
|
|
647
|
+
# @returns [OpenSSL::SSL::SSLContext] The configured SSL context.
|
|
648
|
+
#
|
|
649
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:93
|
|
650
|
+
def build_context(context = T.unsafe(nil)); end
|
|
651
|
+
|
|
652
|
+
# Connect to the underlying endpoint and establish a SSL connection.
|
|
653
|
+
# @yields {|socket| ...} If a block is given, yields the connected SSL socket.
|
|
654
|
+
# @parameter socket [Socket] The connected SSL socket.
|
|
655
|
+
# @returns [Socket] the connected socket
|
|
656
|
+
#
|
|
657
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:153
|
|
658
|
+
def connect(&block); end
|
|
659
|
+
|
|
660
|
+
# Get or build the SSL context.
|
|
661
|
+
# @returns [OpenSSL::SSL::SSLContext] The SSL context.
|
|
662
|
+
#
|
|
663
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:110
|
|
664
|
+
def context; end
|
|
665
|
+
|
|
666
|
+
# Enumerate all endpoints by wrapping each underlying endpoint with SSL.
|
|
667
|
+
# @yields {|endpoint| ...} For each underlying endpoint, yields an SSL-wrapped endpoint.
|
|
668
|
+
# @parameter endpoint [SSLEndpoint] An SSL endpoint.
|
|
669
|
+
#
|
|
670
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:179
|
|
671
|
+
def each; end
|
|
672
|
+
|
|
673
|
+
# @attribute [Generic] The underlying endpoint.
|
|
674
|
+
#
|
|
675
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:74
|
|
676
|
+
def endpoint; end
|
|
677
|
+
|
|
678
|
+
# Get the hostname for SSL verification.
|
|
679
|
+
# @returns [String, nil] The hostname from options or the underlying endpoint.
|
|
680
|
+
#
|
|
681
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:69
|
|
682
|
+
def hostname; end
|
|
683
|
+
|
|
684
|
+
# Get a detailed string representation of the SSL endpoint.
|
|
685
|
+
# @returns [String] A detailed string representation including the underlying endpoint.
|
|
686
|
+
#
|
|
687
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:57
|
|
688
|
+
def inspect; end
|
|
689
|
+
|
|
690
|
+
# Create an SSL server socket from an IO object.
|
|
691
|
+
# @parameter io [IO] The underlying IO object.
|
|
692
|
+
# @returns [OpenSSL::SSL::SSLServer] A new SSL server socket.
|
|
693
|
+
#
|
|
694
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:117
|
|
695
|
+
def make_server(io); end
|
|
696
|
+
|
|
697
|
+
# Create an SSL client socket from an IO object.
|
|
698
|
+
# @parameter io [IO] The underlying IO object.
|
|
699
|
+
# @returns [OpenSSL::SSL::SSLSocket] A new SSL client socket.
|
|
700
|
+
#
|
|
701
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:126
|
|
702
|
+
def make_socket(io); end
|
|
703
|
+
|
|
704
|
+
# @attribute [Hash] The options hash.
|
|
705
|
+
#
|
|
706
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:76
|
|
707
|
+
def options; end
|
|
708
|
+
|
|
709
|
+
# Get SSL parameters from options.
|
|
710
|
+
# @returns [Hash, nil] SSL parameters if specified in options.
|
|
711
|
+
#
|
|
712
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:80
|
|
713
|
+
def params; end
|
|
714
|
+
|
|
715
|
+
# Get the transport-neutral TLS configuration from options.
|
|
716
|
+
# @returns [TLS::Configuration, nil] The TLS configuration if specified.
|
|
717
|
+
#
|
|
718
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:86
|
|
719
|
+
def tls_configuration; end
|
|
720
|
+
|
|
721
|
+
# Get a string representation of the SSL endpoint.
|
|
722
|
+
# @returns [String] A string representation showing the underlying endpoint.
|
|
723
|
+
#
|
|
724
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:51
|
|
725
|
+
def to_s; end
|
|
726
|
+
end
|
|
727
|
+
|
|
728
|
+
# This class doesn't exert ownership over the specified socket, wraps a native ::IO.
|
|
729
|
+
#
|
|
730
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:10
|
|
731
|
+
class IO::Endpoint::SocketEndpoint < ::IO::Endpoint::Generic
|
|
732
|
+
# Initialize a new socket endpoint.
|
|
733
|
+
# @parameter socket [Socket] The socket to wrap.
|
|
734
|
+
# @parameter options [Hash] Additional options to pass to the parent class.
|
|
735
|
+
#
|
|
736
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:14
|
|
737
|
+
def initialize(socket, **options); end
|
|
738
|
+
|
|
739
|
+
# Bind using the wrapped socket.
|
|
740
|
+
# @yields {|socket| ...} If a block is given, yields the socket.
|
|
741
|
+
# @parameter socket [Socket] The socket.
|
|
742
|
+
# @returns [Socket] The socket.
|
|
743
|
+
#
|
|
744
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:39
|
|
745
|
+
def bind(&block); end
|
|
746
|
+
|
|
747
|
+
# Connect using the wrapped socket.
|
|
748
|
+
# @yields {|socket| ...} If a block is given, yields the socket.
|
|
749
|
+
# @parameter socket [Socket] The socket.
|
|
750
|
+
# @returns [Socket] The socket.
|
|
751
|
+
#
|
|
752
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:51
|
|
753
|
+
def connect(&block); end
|
|
754
|
+
|
|
755
|
+
# Get a detailed string representation of the socket endpoint.
|
|
756
|
+
# @returns [String] A detailed string representation including the socket.
|
|
757
|
+
#
|
|
758
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:28
|
|
759
|
+
def inspect; end
|
|
760
|
+
|
|
761
|
+
# @attribute [Socket] The wrapped socket.
|
|
762
|
+
#
|
|
763
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:33
|
|
764
|
+
def socket; end
|
|
765
|
+
|
|
766
|
+
# Get a string representation of the socket endpoint.
|
|
767
|
+
# @returns [String] A string representation showing the socket.
|
|
768
|
+
#
|
|
769
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/socket_endpoint.rb:22
|
|
770
|
+
def to_s; end
|
|
771
|
+
end
|
|
772
|
+
|
|
773
|
+
# @namespace
|
|
774
|
+
#
|
|
775
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/certificates.rb:8
|
|
776
|
+
module IO::Endpoint::TLS; end
|
|
777
|
+
|
|
778
|
+
# Utilities for parsing PEM-encoded certificates.
|
|
779
|
+
#
|
|
780
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/certificates.rb:10
|
|
781
|
+
module IO::Endpoint::TLS::Certificates
|
|
782
|
+
class << self
|
|
783
|
+
# Parse a PEM-encoded certificate bundle into individual certificates.
|
|
784
|
+
# @parameter certificate_bundle [String] One or more certificates encoded as PEM.
|
|
785
|
+
# @returns [Array(String)] The individual PEM-encoded certificates in their original order.
|
|
786
|
+
# @raises [ArgumentError] If the bundle does not contain any certificates.
|
|
787
|
+
# @raises [TypeError] If the bundle is not a string.
|
|
788
|
+
#
|
|
789
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/certificates.rb:20
|
|
790
|
+
def parse(certificate_bundle); end
|
|
791
|
+
end
|
|
792
|
+
end
|
|
793
|
+
|
|
794
|
+
# Matches individual certificates in a PEM bundle.
|
|
795
|
+
#
|
|
796
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/certificates.rb:12
|
|
797
|
+
IO::Endpoint::TLS::Certificates::CERTIFICATE_PATTERN = T.let(T.unsafe(nil), Regexp)
|
|
798
|
+
|
|
799
|
+
# Represents transport-neutral TLS certificate and verification configuration.
|
|
800
|
+
#
|
|
801
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:12
|
|
802
|
+
class IO::Endpoint::TLS::Configuration
|
|
803
|
+
# Initialize a TLS configuration from PEM-encoded certificate and private key material.
|
|
804
|
+
# @parameter trust_store [TrustStore | Nil] The trusted certificate sources.
|
|
805
|
+
# @parameter certificate_chain [Array(String) | Nil] The ordered local certificate chain encoded as individual PEM strings, with the leaf certificate followed by any intermediates.
|
|
806
|
+
# @parameter private_key [String | Nil] The private key encoded as PEM.
|
|
807
|
+
# @parameter verification [Symbol | Nil] The peer verification policy: `:none`, `:peer`, or `:required`. When omitted, `:peer` is used if a trust store is provided.
|
|
808
|
+
# @raises [ArgumentError] If the certificate chain and private key are not provided together, or the verification policy is invalid.
|
|
809
|
+
# @raises [TypeError] If the certificate chain or private key uses an unsupported representation.
|
|
810
|
+
#
|
|
811
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:20
|
|
812
|
+
def initialize(trust_store: T.unsafe(nil), certificate_chain: T.unsafe(nil), private_key: T.unsafe(nil), verification: T.unsafe(nil)); end
|
|
813
|
+
|
|
814
|
+
# Compare configurations by their certificate material and verification policy.
|
|
815
|
+
# @parameter other [Object] The object to compare.
|
|
816
|
+
# @returns [Boolean] Whether both configurations have the same class and values.
|
|
817
|
+
#
|
|
818
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:65
|
|
819
|
+
def ==(other); end
|
|
820
|
+
|
|
821
|
+
# @attribute [Array(String) | Nil] The ordered local certificate chain encoded as individual PEM strings, with the leaf certificate followed by any intermediates.
|
|
822
|
+
#
|
|
823
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:54
|
|
824
|
+
def certificate_chain; end
|
|
825
|
+
|
|
826
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:73
|
|
827
|
+
def eql?(other); end
|
|
828
|
+
|
|
829
|
+
# Freeze the configuration and independent copies of its certificate material, without freezing caller-owned values.
|
|
830
|
+
# @returns [Configuration] This immutable configuration. Use `dup.freeze` to preserve the original configuration too.
|
|
831
|
+
#
|
|
832
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:83
|
|
833
|
+
def freeze; end
|
|
834
|
+
|
|
835
|
+
# Compute a hash from the configuration values. Freeze the configuration before using it as a hash key.
|
|
836
|
+
# @returns [Integer] The hash of the configuration.
|
|
837
|
+
#
|
|
838
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:77
|
|
839
|
+
def hash; end
|
|
840
|
+
|
|
841
|
+
# Get a representation of the configuration without exposing certificate or private key material.
|
|
842
|
+
# @returns [String] A redacted representation of the configuration.
|
|
843
|
+
#
|
|
844
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:101
|
|
845
|
+
def inspect; end
|
|
846
|
+
|
|
847
|
+
# @attribute [String | Nil] The private key encoded as PEM.
|
|
848
|
+
#
|
|
849
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:57
|
|
850
|
+
def private_key; end
|
|
851
|
+
|
|
852
|
+
# @attribute [TrustStore | Nil] The trusted certificate sources.
|
|
853
|
+
#
|
|
854
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:51
|
|
855
|
+
def trust_store; end
|
|
856
|
+
|
|
857
|
+
# @attribute [Symbol | Nil] The peer verification policy.
|
|
858
|
+
#
|
|
859
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:60
|
|
860
|
+
def verification; end
|
|
861
|
+
|
|
862
|
+
# Whether peer certificates should be verified.
|
|
863
|
+
# @returns [Boolean] Whether peer verification is enabled.
|
|
864
|
+
#
|
|
865
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/configuration.rb:95
|
|
866
|
+
def verify_peer?; end
|
|
867
|
+
end
|
|
868
|
+
|
|
869
|
+
# Provides OpenSSL compilation for transport-neutral TLS configuration.
|
|
870
|
+
#
|
|
871
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/openssl.rb:14
|
|
872
|
+
module IO::Endpoint::TLS::OpenSSL
|
|
873
|
+
class << self
|
|
874
|
+
# Apply transport-neutral TLS configuration to an OpenSSL context.
|
|
875
|
+
# @parameter context [OpenSSL::SSL::SSLContext] The OpenSSL context to configure.
|
|
876
|
+
# @parameter configuration [Configuration] The transport-neutral TLS configuration.
|
|
877
|
+
# @parameter hostname [String | Nil] The hostname to verify for client connections.
|
|
878
|
+
# @returns [OpenSSL::SSL::SSLContext] The configured OpenSSL context.
|
|
879
|
+
#
|
|
880
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/openssl.rb:33
|
|
881
|
+
def apply(context, configuration, hostname: T.unsafe(nil)); end
|
|
882
|
+
|
|
883
|
+
# Build an OpenSSL certificate store from transport-neutral trusted certificate configuration.
|
|
884
|
+
# @parameter trust_store [TrustStore] The trusted certificate sources.
|
|
885
|
+
# @returns [OpenSSL::X509::Store] The configured OpenSSL certificate store.
|
|
886
|
+
#
|
|
887
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/openssl.rb:18
|
|
888
|
+
def build_certificate_store(trust_store); end
|
|
889
|
+
end
|
|
890
|
+
end
|
|
891
|
+
|
|
892
|
+
# Represents transport-neutral trusted certificate sources.
|
|
893
|
+
#
|
|
894
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:12
|
|
895
|
+
class IO::Endpoint::TLS::TrustStore
|
|
896
|
+
# Initialize a trust store from PEM-encoded trusted certificates.
|
|
897
|
+
# @parameter certificates [Array(String)] The trusted certificates encoded as PEM.
|
|
898
|
+
# @parameter system_certificates [Boolean] Whether system-provided trusted certificates should be included.
|
|
899
|
+
# @raises [ArgumentError] If no source of trusted certificates is specified.
|
|
900
|
+
# @raises [TypeError] If certificates are not provided as strings.
|
|
901
|
+
#
|
|
902
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:36
|
|
903
|
+
def initialize(certificates: T.unsafe(nil), system_certificates: T.unsafe(nil)); end
|
|
904
|
+
|
|
905
|
+
# Compare trust stores by their ordered certificates and system certificate policy.
|
|
906
|
+
# @parameter other [Object] The object to compare.
|
|
907
|
+
# @returns [Boolean] Whether both trust stores have the same class and values.
|
|
908
|
+
#
|
|
909
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:61
|
|
910
|
+
def ==(other); end
|
|
911
|
+
|
|
912
|
+
# @attribute [Array(String)] The individual trusted certificates encoded as PEM.
|
|
913
|
+
#
|
|
914
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:50
|
|
915
|
+
def certificates; end
|
|
916
|
+
|
|
917
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:67
|
|
918
|
+
def eql?(other); end
|
|
919
|
+
|
|
920
|
+
# Freeze the trust store and independent copies of its certificates, without freezing caller-owned values.
|
|
921
|
+
# @returns [TrustStore] This immutable trust store. Use `dup.freeze` to preserve the original trust store too.
|
|
922
|
+
#
|
|
923
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:77
|
|
924
|
+
def freeze; end
|
|
925
|
+
|
|
926
|
+
# Compute a hash from the trust store values. Freeze the trust store before using it as a hash key.
|
|
927
|
+
# @returns [Integer] The hash of the trust store.
|
|
928
|
+
#
|
|
929
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:71
|
|
930
|
+
def hash; end
|
|
931
|
+
|
|
932
|
+
# Get a representation of the trust store without exposing certificate material.
|
|
933
|
+
# @returns [String] A redacted representation of the trust store.
|
|
934
|
+
#
|
|
935
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:87
|
|
936
|
+
def inspect; end
|
|
937
|
+
|
|
938
|
+
# Whether system-provided trusted certificates should be included.
|
|
939
|
+
# @returns [Boolean] `true` if system-provided trusted certificates should be included.
|
|
940
|
+
#
|
|
941
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:54
|
|
942
|
+
def system_certificates?; end
|
|
943
|
+
|
|
944
|
+
class << self
|
|
945
|
+
# Load a PEM-encoded certificate bundle from the given path.
|
|
946
|
+
# @parameter path [String | Interface(:to_path)] The path to the certificate bundle.
|
|
947
|
+
# @parameter options [Hash] Options forwarded to {.parse}.
|
|
948
|
+
# @returns [TrustStore] The loaded trust store.
|
|
949
|
+
#
|
|
950
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:17
|
|
951
|
+
def load(path, **options); end
|
|
952
|
+
|
|
953
|
+
# Parse a PEM-encoded certificate bundle into a trust store.
|
|
954
|
+
# @parameter certificate_bundle [String] One or more trusted certificates encoded as PEM.
|
|
955
|
+
# @parameter system_certificates [Boolean] Whether system-provided trusted certificates should be included.
|
|
956
|
+
# @returns [TrustStore] The parsed trust store.
|
|
957
|
+
# @raises [ArgumentError] If the bundle does not contain any certificates.
|
|
958
|
+
# @raises [TypeError] If the bundle is not a string.
|
|
959
|
+
#
|
|
960
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/tls/trust_store.rb:27
|
|
961
|
+
def parse(certificate_bundle, system_certificates: T.unsafe(nil)); end
|
|
962
|
+
end
|
|
963
|
+
end
|
|
964
|
+
|
|
965
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/version.rb:10
|
|
966
|
+
IO::Endpoint::VERSION = T.let(T.unsafe(nil), String)
|
|
967
|
+
|
|
968
|
+
# Represents a wrapper for socket operations that provides scheduling and configuration.
|
|
969
|
+
#
|
|
970
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:10
|
|
971
|
+
class IO::Endpoint::Wrapper
|
|
972
|
+
include ::Socket::Constants
|
|
973
|
+
|
|
974
|
+
# Bind to a local address and accept connections in a loop.
|
|
975
|
+
#
|
|
976
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:203
|
|
977
|
+
def accept(server, timeout: T.unsafe(nil), linger: T.unsafe(nil), **options, &block); end
|
|
978
|
+
|
|
979
|
+
# Legacy method for compatibility with older code.
|
|
980
|
+
#
|
|
981
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:36
|
|
982
|
+
def async(&block); end
|
|
983
|
+
|
|
984
|
+
# Bind to a local address.
|
|
985
|
+
# @example
|
|
986
|
+
# socket = Async::IO::Socket.bind(Async::IO::Address.tcp("0.0.0.0", 9090))
|
|
987
|
+
# @parameter local_address [Address] The local address to bind to.
|
|
988
|
+
# @parameter reuse_port [Boolean] Allow this port to be bound in multiple processes.
|
|
989
|
+
# @parameter reuse_address [Boolean] Allow this port to be bound in multiple processes.
|
|
990
|
+
# @parameter linger [Boolean] Wait for data to be sent before closing the socket.
|
|
991
|
+
# @parameter protocol [Integer] The socket protocol to use.
|
|
992
|
+
#
|
|
993
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:144
|
|
994
|
+
def bind(local_address, protocol: T.unsafe(nil), reuse_address: T.unsafe(nil), reuse_port: T.unsafe(nil), linger: T.unsafe(nil), bound_timeout: T.unsafe(nil), backlog: T.unsafe(nil), **options, &block); end
|
|
995
|
+
|
|
996
|
+
# Establish a connection to a given `remote_address`.
|
|
997
|
+
# @example
|
|
998
|
+
# socket = Async::IO::Socket.connect(Async::IO::Address.tcp("8.8.8.8", 53))
|
|
999
|
+
# @parameter remote_address [Address] The remote address to connect to.
|
|
1000
|
+
# @parameter linger [Boolean] Wait for data to be sent before closing the socket.
|
|
1001
|
+
# @parameter local_address [Address] The local address to bind to before connecting.
|
|
1002
|
+
#
|
|
1003
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:82
|
|
1004
|
+
def connect(remote_address, local_address: T.unsafe(nil), linger: T.unsafe(nil), timeout: T.unsafe(nil), buffered: T.unsafe(nil), **options); end
|
|
1005
|
+
|
|
1006
|
+
# Schedule a block to run asynchronously.
|
|
1007
|
+
# Uses Fiber scheduler if available, otherwise falls back to Thread.
|
|
1008
|
+
# @yields { ...} The block to schedule.
|
|
1009
|
+
# @returns [Fiber, Thread] The scheduled fiber or thread.
|
|
1010
|
+
# Schedule a block to run asynchronously.
|
|
1011
|
+
# Uses Thread for scheduling.
|
|
1012
|
+
# @yields { ...} The block to schedule.
|
|
1013
|
+
# @returns [Thread] The scheduled thread.
|
|
1014
|
+
#
|
|
1015
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:18
|
|
1016
|
+
def schedule(&block); end
|
|
1017
|
+
|
|
1018
|
+
# Set whether a socket should be buffered.
|
|
1019
|
+
# @parameter socket [Socket] The socket to configure.
|
|
1020
|
+
# @parameter buffered [Boolean] Whether the socket should be buffered.
|
|
1021
|
+
#
|
|
1022
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:52
|
|
1023
|
+
def set_buffered(socket, buffered); end
|
|
1024
|
+
|
|
1025
|
+
# Set the timeout for an IO object.
|
|
1026
|
+
# @parameter io [IO] The IO object to set timeout on.
|
|
1027
|
+
# @parameter timeout [Numeric, nil] The timeout value.
|
|
1028
|
+
#
|
|
1029
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:43
|
|
1030
|
+
def set_timeout(io, timeout); end
|
|
1031
|
+
|
|
1032
|
+
# Accept a connection from a bound socket.
|
|
1033
|
+
# This is an extension point for subclasses to provide additional functionality.
|
|
1034
|
+
#
|
|
1035
|
+
# @parameter server [Socket] The bound server socket.
|
|
1036
|
+
# @returns [Tuple(Socket, Address)] The connected socket and the remote address.
|
|
1037
|
+
#
|
|
1038
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:198
|
|
1039
|
+
def socket_accept(server); end
|
|
1040
|
+
|
|
1041
|
+
# Connect a socket to a remote address.
|
|
1042
|
+
# This is an extension point for subclasses to provide additional functionality.
|
|
1043
|
+
#
|
|
1044
|
+
# @parameter socket [Socket] The socket to connect.
|
|
1045
|
+
# @parameter remote_address [Address] The remote address to connect to.
|
|
1046
|
+
#
|
|
1047
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:72
|
|
1048
|
+
def socket_connect(socket, remote_address); end
|
|
1049
|
+
|
|
1050
|
+
class << self
|
|
1051
|
+
# Get the default wrapper instance.
|
|
1052
|
+
# @returns [Wrapper] The default wrapper instance.
|
|
1053
|
+
#
|
|
1054
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:240
|
|
1055
|
+
def default; end
|
|
1056
|
+
end
|
|
1057
|
+
end
|
|
1058
|
+
|
|
1059
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:236
|
|
1060
|
+
IO::Endpoint::Wrapper::DEFAULT = T.let(T.unsafe(nil), IO::Endpoint::Wrapper)
|
|
1061
|
+
|
|
1062
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/wrapper.rb:133
|
|
1063
|
+
IO::Endpoint::Wrapper::ServerSocket = Socket
|
|
1064
|
+
|
|
1065
|
+
IO::PRIORITY = T.let(T.unsafe(nil), Integer)
|
|
1066
|
+
IO::READABLE = T.let(T.unsafe(nil), Integer)
|
|
1067
|
+
IO::WRITABLE = T.let(T.unsafe(nil), Integer)
|
|
1068
|
+
|
|
1069
|
+
# Represents an SSL socket with additional methods for compatibility.
|
|
1070
|
+
#
|
|
1071
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:17
|
|
1072
|
+
class OpenSSL::SSL::SSLSocket
|
|
1073
|
+
include ::Enumerable
|
|
1074
|
+
|
|
1075
|
+
# Start the SSL handshake (alias for accept).
|
|
1076
|
+
#
|
|
1077
|
+
# pkg:gem/io-endpoint#lib/io/endpoint/ssl_endpoint.rb:20
|
|
1078
|
+
def start; end
|
|
1079
|
+
end
|