digital-transport 0.5.0 → 0.6.0

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
  SHA1:
3
- metadata.gz: c8049be40a3e3b583d7bd139f725f8970b19cad9
4
- data.tar.gz: 5af871b954f84474022cd6945249b66cd1ee7215
3
+ metadata.gz: ebc66bca4fa184489e9e3150ffe00fcc1cc14d26
4
+ data.tar.gz: 43e9b5b2de33c6fc647a300e1a6228386b824684
5
5
  SHA512:
6
- metadata.gz: 0bf2e6aab9e46c8b95c7e21a7e365a915f89b9ba90058771ebe3e4885a9c87e72992402c563d96d53519a872f1d30f160a9fe5f0dd73867d3b095923e4a48437
7
- data.tar.gz: a3a649d45353ee204e39fdb560f358cd686239dc7797c4dd0cc8bbfc815314998db9aea1602f722b49864430c276af2ffeb0c857ae1b388dc8ce347261eece4e
6
+ metadata.gz: 395e76d6e3d347c611c798b4078481b18e52f4971ef3cb582a237933f970a0c7b6330e7e05abea3ca234511f1ae490bfeab7577232ad08d2a86f2d0853cd2459
7
+ data.tar.gz: fb9c67b12c6cb9a2a5ee19a9c586a7bb30e01d50c0b1d35938fda3b71f8787b21c1503cdcb09a7898038b897fb0b58605dbcea2e9ba5dd13ca8cca34be291785
@@ -97,15 +97,19 @@ module Digital
97
97
  def connect_nonblock(io_like, endpoint, timeout)
98
98
  # IO.connect_nonblock retrun value is different across multiple platform.
99
99
  io_like.connect_nonblock(endpoint)
100
- Either.right(self)
100
+ raise Errno::EISCONN
101
101
  rescue Errno::EINPROGRESS # connection in progress, wait a bit.
102
102
  IO.select(nil, [io_like], nil, timeout) ? retry : nil
103
103
  rescue Errno::EISCONN # The socket is already connected.
104
- @io = io_like
104
+ init_io io_like
105
105
  Either.right(self)
106
106
  rescue => ex
107
107
  Either.left(ex)
108
108
  end
109
+
110
+ def init_io(io)
111
+ @io = io
112
+ end
109
113
  end
110
114
  end
111
115
  end
@@ -1,5 +1,5 @@
1
1
  module Digital
2
2
  module Transport
3
- VERSION = '0.5.0'.freeze
3
+ VERSION = '0.6.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digital-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Lishtaba