async-io 1.16.0 → 1.16.1
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 +4 -4
- data/lib/async/io/socket.rb +1 -1
- data/lib/async/io/version.rb +1 -1
- data/spec/async/io/endpoint_spec.rb +8 -0
- data/spec/async/io/socket_spec.rb +12 -2
- 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: 379d35c46cafb056a9ad45909ba233b60c2494fcf2c822e114d6e4fecb489417
|
4
|
+
data.tar.gz: f6a5aa2014a2af8164517d3f25147d3a041b04fcc3180d271af07c6724e60aad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce284102e8f3c8dd0b107f6d0958aff37e4aeafb71784c77b4e647e19f05346543b9f2e7d4fc738f29a45a88fa7e69e2d8df687f3325dd4a5f42c1b4ce03cc13
|
7
|
+
data.tar.gz: b1f090f450cce626da8b04169bd04c3a21c87184295d3bd52c157d69df336aa50ac136b7e19b09010945fc575855f7e7eaa9bd12b3408785898d2a333f5dfb06
|
data/lib/async/io/socket.rb
CHANGED
data/lib/async/io/version.rb
CHANGED
@@ -50,6 +50,14 @@ RSpec.describe Async::IO::Endpoint do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
describe Async::IO::Endpoint.tcp('0.0.0.0', 0) do
|
54
|
+
it "should be a tcp binding" do
|
55
|
+
subject.bind do |server|
|
56
|
+
expect(server.local_address.ip_port).to be > 10000
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
53
61
|
describe Async::IO::SocketEndpoint.new(TCPServer.new('0.0.0.0', 1234)) do
|
54
62
|
it "should bind to given socket" do
|
55
63
|
subject.bind do |server|
|
@@ -52,13 +52,23 @@ RSpec.describe Async::IO::Socket do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
describe '#bind' do
|
55
|
-
let(:address) {Async::IO::Address.tcp('127.0.0.1', 1)}
|
56
|
-
|
57
55
|
it "should fail to bind to port < 1024" do
|
56
|
+
address = Async::IO::Address.tcp('127.0.0.1', 1)
|
57
|
+
|
58
58
|
expect do
|
59
59
|
Async::IO::Socket.bind(address)
|
60
60
|
end.to raise_error(Errno::EACCES)
|
61
61
|
end
|
62
|
+
|
63
|
+
it "can bind to port 0" do
|
64
|
+
address = Async::IO::Address.tcp('127.0.0.1', 0)
|
65
|
+
|
66
|
+
Async::IO::Socket.bind(address) do |socket|
|
67
|
+
expect(socket.local_address.ip_port).to be > 10000
|
68
|
+
|
69
|
+
expect(Async::Task.current.annotation).to include("#{socket.local_address.ip_port}")
|
70
|
+
end
|
71
|
+
end
|
62
72
|
end
|
63
73
|
|
64
74
|
describe '.pair' do
|
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.16.
|
4
|
+
version: 1.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|