tcp-client 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/tcp-client/address.rb +3 -3
- data/lib/tcp-client/version.rb +1 -1
- data/lib/tcp-client.rb +2 -1
- data/tcp-client.gemspec +2 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe13751730310529097b79992b58a5ed212ecc4119c576c04bcf7b0c4a0373c7
|
4
|
+
data.tar.gz: 558f73ee8e06309c8d6ca52cdc4309ceac853a9587b6891959b67f5d49c89413
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
data/lib/tcp-client/address.rb
CHANGED
@@ -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
|
25
|
-
# - a valid TCPv4 address like
|
26
|
-
# - a valid TCPv6 address like
|
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
|
#
|
data/lib/tcp-client/version.rb
CHANGED
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.
|
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: []
|