async-io 1.16.0 → 1.16.1

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: 11d4123b62b4c9d36348dffe2ce2e450924d491db1b3bd4f4ded739140637300
4
- data.tar.gz: f707c236c48b1169dc1d26fe9101782c7c11ab26c9c05a6e5cd19bfa784183ca
3
+ metadata.gz: 379d35c46cafb056a9ad45909ba233b60c2494fcf2c822e114d6e4fecb489417
4
+ data.tar.gz: f6a5aa2014a2af8164517d3f25147d3a041b04fcc3180d271af07c6724e60aad
5
5
  SHA512:
6
- metadata.gz: c8f33cc994bf02d7ece78d249bf85418c9f5de2c079f49053cb4f7534e5d04b12f40a468fc7ef095c0cbacd04c1fe37291726b20c07f2f34c52453ac9b8ce4cb
7
- data.tar.gz: 65424003ca8e5904e4984af6bf558f8e7378e873f6f1ec018aea0669187786ef3d348c4c546a5ecb8e80edc526eb41eb5ac09242f714263fec1badacad3d9cf9
6
+ metadata.gz: ce284102e8f3c8dd0b107f6d0958aff37e4aeafb71784c77b4e647e19f05346543b9f2e7d4fc738f29a45a88fa7e69e2d8df687f3325dd4a5f42c1b4ce03cc13
7
+ data.tar.gz: b1f090f450cce626da8b04169bd04c3a21c87184295d3bd52c157d69df336aa50ac136b7e19b09010945fc575855f7e7eaa9bd12b3408785898d2a333f5dfb06
@@ -172,7 +172,7 @@ module Async
172
172
  return wrapper unless block_given?
173
173
 
174
174
  task.async do |task|
175
- task.annotate "binding to #{local_address.inspect}"
175
+ task.annotate "binding to #{wrapper.local_address.inspect}"
176
176
 
177
177
  begin
178
178
  yield wrapper, task
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module IO
23
- VERSION = "1.16.0"
23
+ VERSION = "1.16.1"
24
24
  end
25
25
  end
@@ -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.0
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-09-30 00:00:00.000000000 Z
11
+ date: 2018-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async