tcp-client 0.0.5 → 0.0.6
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/tcp-client.rb +6 -1
- data/lib/tcp-client/configuration.rb +1 -1
- data/lib/tcp-client/mixin/io_timeout.rb +1 -1
- data/lib/tcp-client/ssl_socket.rb +8 -3
- data/lib/tcp-client/version.rb +1 -1
- 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: 9a5a96328918c653aaec2296d19a7434b65c8801f3a1132a152dcd66326bc9ce
|
4
|
+
data.tar.gz: 5add4cd9d2607a90522b14c04a8b9d60a27bcad30c0f56212aba5df6c5036ac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859acc902ed173236fac760ce2edbbda4353bf7fb438ecdb3856bdba3076a464a34f542458abc5b1fb2ec157b4f3ab007e0eb67123c551f1b6abedc6f810d978
|
7
|
+
data.tar.gz: 36b9c267842f00e2d6181d2523b84b776528b7d754fb4eb378fbdb4fc8d33fbb43ac7b9faf5ff613cf34c4687cc2eab74eaff04601fa72196efe3787d622dc7d
|
data/lib/tcp-client.rb
CHANGED
@@ -70,6 +70,11 @@ class TCPClient
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def write(*msg, timeout: @write_timeout)
|
73
|
-
closed? ? NotConnected.raise!(self)
|
73
|
+
closed? ? NotConnected.raise!(self) : @socket.write(*msg, timeout: timeout, exception: Timeout)
|
74
|
+
end
|
75
|
+
|
76
|
+
def flush
|
77
|
+
@socket.flush unless closed?
|
78
|
+
self
|
74
79
|
end
|
75
80
|
end
|
@@ -13,7 +13,12 @@ class TCPClient
|
|
13
13
|
def initialize(socket, address, configuration, exception)
|
14
14
|
ssl_params = Hash[configuration.ssl_params]
|
15
15
|
super(socket, create_context(ssl_params))
|
16
|
-
connect_to(
|
16
|
+
connect_to(
|
17
|
+
address,
|
18
|
+
ssl_params[:verify_mode] != OpenSSL::SSL::VERIFY_NONE,
|
19
|
+
configuration.connect_timeout,
|
20
|
+
exception
|
21
|
+
)
|
17
22
|
end
|
18
23
|
|
19
24
|
private
|
@@ -24,10 +29,10 @@ class TCPClient
|
|
24
29
|
ctx
|
25
30
|
end
|
26
31
|
|
27
|
-
def connect_to(address, timeout, exception)
|
32
|
+
def connect_to(address, check, timeout, exception)
|
28
33
|
self.hostname = address.hostname
|
29
34
|
timeout ? with_deadline(Time.now + timeout, exception){ connect_nonblock(exception: false) } : connect
|
30
|
-
post_connection_check(address.hostname)
|
35
|
+
post_connection_check(address.hostname) if check
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
data/lib/tcp-client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tcp-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Blumtritt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|