digital-transport 0.3.0 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8aa749e3a76812175d3c1125f365f43a53123bad
4
- data.tar.gz: 7344a720593ab647f347ee7c4169c70c452ead76
3
+ metadata.gz: 507c30df6b4922032b78a429b53c45727de4a1e5
4
+ data.tar.gz: cf66ce9d410277c8f57872da99f767e9470e6a86
5
5
  SHA512:
6
- metadata.gz: 12bcecf1723bb148e0737a913dbac593879a7f785cf55e869472d705fa6561b7e93b1c0446fc06855eff86de534f503ae0734951651a79549a313fd8b4d14bfe
7
- data.tar.gz: c93d10db580b6cfe424738afe6fce4ac73269f72e05a0934fe7d755309a598cd1c79de375b826a4daf40631c891aa4a1d8f3422eb8f33bfa1a579bc2e03ca8da
6
+ metadata.gz: 8bb507f23f253040b712c8d953a47973cf9ffae9d774d2d5eea722703aacb33343a72abba95685d4b07b333532f027142bca9db96e7c6ba7851e3e6385eab918
7
+ data.tar.gz: 00c4a2913cc370de0c0b384bbe01009e82a22bd09435270ab6a4176740f46ced7d63cbe4be28b6d423d1e0fe0e6f06149e89d19d9fcdd40d9d2001f399a4d5e4
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Roman Lishtaba']
10
10
  spec.email = ['roman@lishtaba.com']
11
11
 
12
- spec.summary = %q{interface between multiple transport adapters}
13
- spec.description = %q{Library intended to unify interface between multiple transport adapters}
12
+ spec.summary = 'interface between multiple transport adapters'
13
+ spec.description = 'Library intended to unify interface between multiple transport adapters'
14
14
  spec.homepage = 'https://github.com/rlishtaba/ruby-digital-transport'
15
15
  spec.license = 'MIT'
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|bin)/}) }
@@ -28,4 +28,4 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_dependency 'functional-ruby'
30
30
  spec.add_dependency 'rs_232', '~> 2.0', '>= 2.0.5' unless RUBY_PLATFORM === /java/
31
- end
31
+ end
@@ -32,4 +32,4 @@ module Digital
32
32
  end
33
33
  end
34
34
  end
35
- end
35
+ end
@@ -119,4 +119,4 @@ module Digital
119
119
  end
120
120
  end
121
121
  end
122
- end
122
+ end
@@ -30,9 +30,10 @@ module Digital
30
30
  Socket.new(AF_INET, SOCK_STREAM, 0).tap do |socket|
31
31
  socket.setsockopt(IPPROTO_TCP, TCP_NODELAY, (@opts[:tcp_nodelay] || DEFAULTS[:tcp_no_delay]).to_i)
32
32
  return connect_nonblock(
33
- socket,
34
- Socket.pack_sockaddr_in(@port, @ip),
35
- @opts[:timeout].to_i.nonzero? || DEFAULTS[:timeout])
33
+ socket,
34
+ Socket.pack_sockaddr_in(@port, @ip),
35
+ @opts[:timeout].to_i.nonzero? || DEFAULTS[:timeout]
36
+ )
36
37
  end
37
38
  end
38
39
 
@@ -94,7 +95,9 @@ module Digital
94
95
 
95
96
  # @api private
96
97
  def connect_nonblock(io_like, endpoint, timeout)
97
- io_like.connect_nonblock(endpoint)
98
+ # IO.connect_nonblock retrun value is different across multiple platform.
99
+ io_like.connect_nonblock(endpoint)
100
+ io_like
98
101
  rescue Errno::EINPROGRESS # connection in progress, wait a bit.
99
102
  IO.select(nil, [io_like], nil, timeout) ? retry : nil
100
103
  rescue Errno::EISCONN # The socket is already connected.
@@ -106,4 +109,4 @@ module Digital
106
109
  end
107
110
  end
108
111
  end
109
- end
112
+ end
@@ -1,5 +1,5 @@
1
1
  module Digital
2
2
  module Transport
3
- VERSION = "0.3.0".freeze
3
+ VERSION = '0.4.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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Lishtaba