async-io 1.30.2 → 1.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/io/peer.rb +2 -2
- data/lib/async/io/socket.rb +2 -2
- data/lib/async/io/ssl_socket.rb +1 -3
- data/lib/async/io/stream.rb +2 -2
- data/lib/async/io/tcp_socket.rb +1 -1
- data/lib/async/io/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4bd452ecb8105b456fde28d2af79a2d4b360bac0cad9e7e35cc4f71c6c852d1
|
4
|
+
data.tar.gz: b629d8aed875e23295b8ab01da8b22c5f02a5fc79775a8afddae032531557d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b905369d33bf79d557dcaee2a68ad24979295d64a746e7d05ae182a2cd00abba3db1c8d93e86e4eda525468ef3875adeb747cee9d95439e20a0246c49d9255f3
|
7
|
+
data.tar.gz: 5dba169bd0668e39aba12df17e53ee2f70a211be0b41e5fc6a9b5a1f0e59336b29ac534b67f40014410c70355753bc92be1951929bd6a36df9a166764e5a9c88
|
data/lib/async/io/peer.rb
CHANGED
@@ -59,13 +59,13 @@ module Async
|
|
59
59
|
when 0, IPPROTO_TCP
|
60
60
|
self.setsockopt(IPPROTO_TCP, TCP_NODELAY, value ? 1 : 0)
|
61
61
|
else
|
62
|
-
|
62
|
+
Console.logger.warn(self) {"Unsure how to sync=#{value} for #{self.protocol}!"}
|
63
63
|
end
|
64
64
|
rescue Errno::EINVAL
|
65
65
|
# On Darwin, sometimes occurs when the connection is not yet fully formed. Empirically, TCP_NODELAY is enabled despite this result.
|
66
66
|
rescue Errno::EOPNOTSUPP
|
67
67
|
# Some platforms may simply not support the operation.
|
68
|
-
#
|
68
|
+
# Console.logger.warn(self) {"Unable to set sync=#{value}!"}
|
69
69
|
end
|
70
70
|
|
71
71
|
def sync
|
data/lib/async/io/socket.rb
CHANGED
@@ -116,7 +116,7 @@ module Async
|
|
116
116
|
# @param remote_address [Address] The remote address to connect to.
|
117
117
|
# @option local_address [Address] The local address to bind to before connecting.
|
118
118
|
def self.connect(remote_address, local_address: nil, task: Task.current, **options)
|
119
|
-
|
119
|
+
Console.logger.debug(self) {"Connecting to #{remote_address.inspect}"}
|
120
120
|
|
121
121
|
task.annotate "connecting to #{remote_address.inspect}"
|
122
122
|
|
@@ -154,7 +154,7 @@ module Async
|
|
154
154
|
# @param local_address [Address] The local address to bind to.
|
155
155
|
# @option protocol [Integer] The socket protocol to use.
|
156
156
|
def self.bind(local_address, protocol: 0, task: Task.current, **options, &block)
|
157
|
-
|
157
|
+
Console.logger.debug(self) {"Binding to #{local_address.inspect}"}
|
158
158
|
|
159
159
|
wrapper = build(local_address.afamily, local_address.socktype, protocol, **options) do |socket|
|
160
160
|
socket.bind(local_address.to_sockaddr)
|
data/lib/async/io/ssl_socket.rb
CHANGED
@@ -68,6 +68,7 @@ module Async
|
|
68
68
|
super
|
69
69
|
else
|
70
70
|
io = self.class.wrapped_klass.new(socket.to_io, context)
|
71
|
+
super(io, socket.reactor)
|
71
72
|
|
72
73
|
# We detach the socket from the reactor, otherwise it's possible to add the file descriptor to the selector twice, which is bad.
|
73
74
|
socket.reactor = nil
|
@@ -75,10 +76,7 @@ module Async
|
|
75
76
|
# This ensures that when the internal IO is closed, it also closes the internal socket:
|
76
77
|
io.sync_close = true
|
77
78
|
|
78
|
-
# Copy the timeout:
|
79
79
|
@timeout = socket.timeout
|
80
|
-
|
81
|
-
super(io, socket.reactor)
|
82
80
|
end
|
83
81
|
end
|
84
82
|
|
data/lib/async/io/stream.rb
CHANGED
@@ -259,13 +259,13 @@ module Async
|
|
259
259
|
|
260
260
|
if @read_buffer.empty?
|
261
261
|
if @io.read_nonblock(size, @read_buffer, exception: false)
|
262
|
-
#
|
262
|
+
# Console.logger.debug(self, name: "read") {@read_buffer.inspect}
|
263
263
|
return true
|
264
264
|
end
|
265
265
|
else
|
266
266
|
if chunk = @io.read_nonblock(size, @input_buffer, exception: false)
|
267
267
|
@read_buffer << chunk
|
268
|
-
#
|
268
|
+
# Console.logger.debug(self, name: "read") {@read_buffer.inspect}
|
269
269
|
|
270
270
|
return true
|
271
271
|
end
|
data/lib/async/io/tcp_socket.rb
CHANGED
@@ -40,7 +40,7 @@ module Async
|
|
40
40
|
# We do this unusual dance to avoid leaking an "open" socket instance.
|
41
41
|
socket = Socket.connect(remote_address, local_address: local_address)
|
42
42
|
fd = socket.fcntl(Fcntl::F_DUPFD)
|
43
|
-
|
43
|
+
Console.logger.debug(self) {"Connected to #{remote_address.inspect}: #{fd}"}
|
44
44
|
socket.close
|
45
45
|
|
46
46
|
super(::TCPSocket.for_fd(fd))
|
data/lib/async/io/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|