tcp-client 0.5.0 → 0.5.1
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/configuration.rb +2 -2
- data/lib/tcp-client/version.rb +1 -1
- data/lib/tcp-client.rb +3 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f36e18e6865766292ff44adf5cd46244e8944049f524553ba4168725454a2d0b
|
4
|
+
data.tar.gz: abd4ec63f48c1be4e73922aaed7702bdacebe398e6cda13887fcd2efaa62818c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b5302d3da2d0d46f35fb2370177916b1044b659b1f62bdbf0a30c39581844dd425487a6c94300b4a7afcf25eafef5828a6ef04cb0ff9bcae4fff01a9a312bb
|
7
|
+
data.tar.gz: 54b3505c1eb90565e0a80dab5c92a394883b74cf3bb975ed83df4c1affbad15e9acbfcee7ec3d0a5bb79c1486fa46fbfbd958fc9e43106b9a97dc22411c84335
|
@@ -37,7 +37,7 @@ class TCPClient
|
|
37
37
|
|
38
38
|
def initialize_copy(_org)
|
39
39
|
super
|
40
|
-
@ssl_params = @ssl_params
|
40
|
+
@ssl_params = Hash[@ssl_params] if @ssl_params
|
41
41
|
self
|
42
42
|
end
|
43
43
|
|
@@ -48,7 +48,7 @@ class TCPClient
|
|
48
48
|
def ssl=(value)
|
49
49
|
@ssl_params =
|
50
50
|
if Hash === value
|
51
|
-
value
|
51
|
+
Hash[value]
|
52
52
|
else
|
53
53
|
value ? {} : nil
|
54
54
|
end
|
data/lib/tcp-client/version.rb
CHANGED
data/lib/tcp-client.rb
CHANGED
@@ -91,19 +91,9 @@ class TCPClient
|
|
91
91
|
def create_socket(exception)
|
92
92
|
exception ||= @configuration.connect_timeout_error
|
93
93
|
deadline = Deadline.new(@configuration.connect_timeout)
|
94
|
-
socket = TCPSocket.new(@address, @configuration, deadline, exception)
|
95
|
-
@configuration.ssl?
|
96
|
-
|
97
|
-
|
98
|
-
def as_ssl_socket(socket, deadline, exception)
|
99
|
-
SSLSocket.new(socket, @address, @configuration, deadline, exception)
|
100
|
-
rescue StandardError => e
|
101
|
-
begin
|
102
|
-
socket.close
|
103
|
-
rescue IOError
|
104
|
-
# ignore!
|
105
|
-
end
|
106
|
-
raise(e, cause: e.cause)
|
94
|
+
@socket = TCPSocket.new(@address, @configuration, deadline, exception)
|
95
|
+
return @socket unless @configuration.ssl?
|
96
|
+
SSLSocket.new(@socket, @address, @configuration, deadline, exception)
|
107
97
|
end
|
108
98
|
|
109
99
|
def read_with_deadline(nbytes, deadline, exception)
|
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.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Blumtritt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
rubygems_version: 3.2.
|
117
|
+
rubygems_version: 3.2.22
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: A TCP client implementation with working timeout support.
|