tcp-client 0.9.0 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20df105b07989653ac9e9c877672318e1da4eb6a5171b088b137422ff03d22db
4
- data.tar.gz: 393c2bf3f983f1da7dc8e3517b0cd7b170c2cdede3c546b603def84512e93806
3
+ metadata.gz: fe13751730310529097b79992b58a5ed212ecc4119c576c04bcf7b0c4a0373c7
4
+ data.tar.gz: 558f73ee8e06309c8d6ca52cdc4309ceac853a9587b6891959b67f5d49c89413
5
5
  SHA512:
6
- metadata.gz: c94f0a7c51cd5b33edf0de9fb02d454e539f95b79891ad81c81adb4832829059fc34b8c3d4e141594dd0b95752807f1c32dbc9c5192914a5ec02345bb056075c
7
- data.tar.gz: 1ab3ef36b1534cf697c911c5d4ce01137dc9860598daa34765521cbec48fe6698294402cf0a0b768f2c460212cb3ce9378adb12ba7e65c76f1531e7bd66a1688
6
+ metadata.gz: a2a9d54d6de01896b83180e7e94afde9a1e2b8f62ca24c9e91d63a7c809a06286357fdecb5a3ad6fce1dceaaa50067a6f64263c83f4069d07b3ad837db138b9d
7
+ data.tar.gz: ac6168903ebb5c953e850fb97d80281c63b70b208335d34611f57829199e623fac3fbea85959d09d8c9ddec1edbe23ffef23cd9e5e94e788b74b0ded665dd5c2
data/README.md CHANGED
@@ -2,10 +2,16 @@
2
2
 
3
3
  A TCP client implementation with working timeout support.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/tcp-client.svg)](https://badge.fury.io/rb/tcp-client)
6
+
5
7
  ## Description
6
8
 
7
9
  This Gem implements a TCP client with (optional) SSL support. It is an easy to use, versatile configurable client that can correctly handle time limits. Unlike other implementations, this client respects predefined/configurable time limits for each method (`connect`, `read`, `write`). Deadlines for a sequence of read/write actions can also be monitored.
8
10
 
11
+ ## Help
12
+
13
+ The latest help can be found at [rubydoc.info](https://rubydoc.info/github/mblumtritt/tcp-client/main/index)
14
+
9
15
  ## Sample
10
16
 
11
17
  ```ruby
@@ -30,6 +36,8 @@ TCPClient.with_deadline(1.5, 'www.google.com:443', cfg) do |client|
30
36
  end
31
37
  ```
32
38
 
39
+ For more samples see [the samples dir](https://github.com/mblumtritt/tcp-client/tree/main/sample)
40
+
33
41
  ## Installation
34
42
 
35
43
  Use [Bundler](http://gembundler.com/) to use TCPClient in your own project:
@@ -21,9 +21,9 @@ class TCPClient
21
21
  # Initializes an address
22
22
  # @overload initialize(addr)
23
23
  # The addr can be specified as
24
- # - a valid named address containing the port like +my.host.test:80+
25
- # - a valid TCPv4 address like +142.250.181.206:80+
26
- # - a valid TCPv6 address like +[2001:16b8:5093:3500:ad77:abe6:eb88:47b6]:80+
24
+ # - a valid named address containing the port like "my.host.test:80"
25
+ # - a valid TCPv4 address like "142.250.181.206:80"
26
+ # - a valid TCPv6 address like "[2001:16b8:5093:3500:ad77:abe6:eb88:47b6]:80"
27
27
  #
28
28
  # @param addr [String] address string
29
29
  #
@@ -4,5 +4,5 @@ class TCPClient
4
4
  #
5
5
  # The current gem version.
6
6
  #
7
- VERSION = '0.9.0'
7
+ VERSION = '0.9.1'
8
8
  end
data/lib/tcp-client.rb CHANGED
@@ -133,9 +133,9 @@ class TCPClient
133
133
  #
134
134
  def connect(address, configuration = nil, timeout: nil, exception: nil)
135
135
  close if @socket
136
- raise(NoOpenSSLError) if configuration.ssl? && !defined?(SSLSocket)
137
136
  @address = Address.new(address)
138
137
  @configuration = (configuration || Configuration.default).dup
138
+ raise(NoOpenSSLError) if @configuration.ssl? && !defined?(SSLSocket)
139
139
  @socket = create_socket(timeout, exception)
140
140
  self
141
141
  end
@@ -277,4 +277,5 @@ class TCPClient
277
277
  ].tap do |errors|
278
278
  errors << ::OpenSSL::SSL::SSLError if defined?(::OpenSSL::SSL::SSLError)
279
279
  end.freeze
280
+ private_constant(:NETWORK_ERRORS)
280
281
  end
data/tcp-client.gemspec CHANGED
@@ -23,6 +23,8 @@ Gem::Specification.new do |spec|
23
23
  spec.license = 'BSD-3-Clause'
24
24
 
25
25
  spec.metadata['source_code_uri'] = 'https://github.com/mblumtritt/tcp-client'
26
+ spec.metadata['documentation_uri'] =
27
+ 'https://rubydoc.info/github/mblumtritt/tcp-client'
26
28
  spec.metadata['bug_tracker_uri'] =
27
29
  'https://github.com/mblumtritt/tcp-client/issues'
28
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcp-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Blumtritt
@@ -111,6 +111,7 @@ licenses:
111
111
  - BSD-3-Clause
112
112
  metadata:
113
113
  source_code_uri: https://github.com/mblumtritt/tcp-client
114
+ documentation_uri: https://rubydoc.info/github/mblumtritt/tcp-client
114
115
  bug_tracker_uri: https://github.com/mblumtritt/tcp-client/issues
115
116
  post_install_message:
116
117
  rdoc_options: []