io-endpoint 0.7.0 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f76dc33db329c9e393c817dbc679a3d06c1f523eda8740edd25447ed39f5a1b
4
- data.tar.gz: 3917511b6a08184cad66e734120d8ea039b15645b9f0c1b256a5149372628e56
3
+ metadata.gz: cc53917d52f22c2f27d8f425313d347ee3383cd854970b68664f8b726ce85333
4
+ data.tar.gz: 439e9c04e2b44fe1168cb833ae30b1ad359b74c86e32f43c0922cd8ed3cecdea
5
5
  SHA512:
6
- metadata.gz: 9b685cf7785946c7a856eaf7859ce6c8427c0ad1df532b188c1049432b474afd289fe7e31eff9ee6c4c608d42022b84e48d4b963de563b83482a6daa572520e8
7
- data.tar.gz: f2a96e35cce3eea736e3ac25eabd3674d595753cdfa3caa652f28da4e9793d7d7d51d3518731018ac19716c779092eaea90d51813504cadca6193a64709fe4e1
6
+ metadata.gz: 83ade7682438701b33e2050a69cc38efa3be7fa9bc7f6113263217db12fda799949ba1e3caf894861352cfcc6fc29a987ec25bc253d6d9e78544f24f0f1de50a
7
+ data.tar.gz: d722a9f23ea072246edda82dbc7ce633dc65da9c865f5a1b5e1948ca148ccc438f53e45139870b4739e167db037d4dd11b36a0295851482ff3f5845eb584a42f
checksums.yaml.gz.sig CHANGED
Binary file
@@ -23,6 +23,12 @@ module OpenSSL
23
23
  end
24
24
  end
25
25
 
26
+ unless method_defined?(:remote_address)
27
+ def remote_address
28
+ to_io.remote_address
29
+ end
30
+ end
31
+
26
32
  unless method_defined?(:wait)
27
33
  def wait(*arguments)
28
34
  to_io.wait(*arguments)
@@ -5,6 +5,6 @@
5
5
 
6
6
  class IO
7
7
  module Endpoint
8
- VERSION = "0.7.0"
8
+ VERSION = "0.7.2"
9
9
  end
10
10
  end
@@ -15,7 +15,8 @@ module IO::Endpoint
15
15
  end
16
16
  else
17
17
  def set_timeout(io, timeout)
18
- warn "IO#timeout= not supported on this platform."
18
+ # warn "IO#timeout= not supported on this platform."
19
+ # Unsupported.
19
20
  end
20
21
  end
21
22
 
data/lib/io/readable.rb CHANGED
@@ -1,12 +1,8 @@
1
1
  class IO
2
2
  unless method_defined?(:readable?)
3
3
  def readable?
4
- if self.wait_readable(0).nil?
5
- # timeout means it is not eof
6
- return true
7
- else
8
- !self.eof?
9
- end
4
+ # Do not call `eof?` here as it is not concurrency-safe and it can block.
5
+ !closed?
10
6
  end
11
7
  end
12
8
  end
@@ -16,19 +12,15 @@ require 'socket'
16
12
  class BasicSocket
17
13
  unless method_defined?(:readable?)
18
14
  def readable?
19
- # Is it likely that the socket is still connected?
20
- # May return false positive, but won't return false negative.
21
- return false unless super
22
-
23
15
  # If we can wait for the socket to become readable, we know that the socket may still be open.
24
- result = to_io.recv_nonblock(1, MSG_PEEK, exception: false)
16
+ result = self.recv_nonblock(1, MSG_PEEK, exception: false)
25
17
 
26
18
  # No data was available - newer Ruby can return nil instead of empty string:
27
19
  return false if result.nil?
28
20
 
29
21
  # Either there was some data available, or we can wait to see if there is data avaialble.
30
22
  return !result.empty? || result == :wait_readable
31
- rescue Errno::ECONNRESET
23
+ rescue Errno::ECONNRESET, IOError
32
24
  # This might be thrown by recv_nonblock.
33
25
  return false
34
26
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-endpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,7 +37,7 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2024-04-20 00:00:00.000000000 Z
40
+ date: 2024-04-21 00:00:00.000000000 Z
41
41
  dependencies: []
42
42
  description:
43
43
  email:
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubygems_version: 3.5.3
84
+ rubygems_version: 3.3.7
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Provides a separation of concerns interface for IO endpoints.
metadata.gz.sig CHANGED
Binary file