digital-transport 0.8.5 → 0.8.6

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: 7b6aa7dc67d41061215ecbcc17292e3fb8eafc2c
4
- data.tar.gz: d219d92fc2b03b45f075f7a938ffb122f1451839
3
+ metadata.gz: 63ca928d2d61df4e843e904e37bf8a54407e9726
4
+ data.tar.gz: 5af1b6bb79e5ecde94ecafd27e79d9dfe5822111
5
5
  SHA512:
6
- metadata.gz: cf95fcad843f49a1296b5e8ae2c12e13ded1c20b83710eed782eb0dbf63f63d5138e9d0a227c46bd9d81c4b300178a8a2431019766bf0bedb6b09aa2d651ee6f
7
- data.tar.gz: 75571dbbbc6b478847cb2001348f7aaac30348353a622ef50a3a44eeb7bf79df3336d4ff5da2dd845b775382ee171cea55230331280f4bb3b328edf3b10123a2
6
+ metadata.gz: 41e222b45c2a0e39b475813e87491fe13c5a2e0e1c5606a8f87a9779a374d90c22cf1a2359154a1da8cfe02cdb676b7990edbc102168313fe4756bfe17f71d58
7
+ data.tar.gz: 0b6c047a8dcc7c7db68b3816a89d51d11a784ef10b870166eb6e1814b9f97620e7146ff440805fe4628f020e9eed1dca3275b981bdeedae8c84590aa797a8bdb
@@ -7,16 +7,15 @@ module Digital
7
7
  module Adapters
8
8
  class Tcp
9
9
  include Functional
10
- include Socket::Constants
11
10
  include Digital::Transport::Errors
12
11
  include Digital::Transport::Adapters::Interface
13
12
 
14
- DEFAULTS = { timeout: 10, tcp_no_delay: 1 }.freeze
13
+ DEFAULTS = { timeout: 10, tcp_nodelay: 1 }.freeze
15
14
 
16
15
  def initialize(ip, port, opts = {})
17
- @ip = ip.freeze
16
+ @ip = FinalVar.new(ip)
18
17
  @opts = DEFAULTS.merge(opts.dup).freeze
19
- @port = port
18
+ @port = FinalVar.new(port)
20
19
  @io = nil
21
20
  end
22
21
 
@@ -28,11 +27,11 @@ module Digital
28
27
  #
29
28
  def connect
30
29
  return open? if open?
31
- Socket.new(AF_INET, SOCK_STREAM, 0).tap do |socket|
32
- socket.setsockopt(IPPROTO_TCP, TCP_NODELAY, (@opts[:tcp_nodelay] || DEFAULTS[:tcp_no_delay]).to_i)
30
+ Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0).tap do |socket|
31
+ socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, @opts[:tcp_nodelay].to_i)
33
32
  return connect_nonblock(
34
33
  socket,
35
- Socket.pack_sockaddr_in(@port, @ip),
34
+ Socket.pack_sockaddr_in(@port.value, @ip.value),
36
35
  @opts[:timeout].to_i.nonzero? || DEFAULTS[:timeout]
37
36
  )
38
37
  end
@@ -1,5 +1,5 @@
1
1
  module Digital
2
2
  module Transport
3
- VERSION = '0.8.5'.freeze
3
+ VERSION = '0.8.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digital-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Lishtaba
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-11 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler