resilient_socket 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -37,7 +37,7 @@ to adjust the retry logic
37
37
  ### Dependencies
38
38
 
39
39
  - Ruby MRI 1.8.7 (or above), Ruby 1.9.3, Or JRuby 1.6.3 (or above)
40
- - [SemanticLogger](http://github.com/ClarityServices/semantic-logger)
40
+ - [SemanticLogger](http://github.com/ClarityServices/semantic_logger)
41
41
 
42
42
  ### Install
43
43
 
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ task :gem do |t|
19
19
  spec.date = Date.today.to_s
20
20
  spec.summary = "A Resilient TCP Socket Client with built-in timeouts, retries, and logging"
21
21
  spec.description = "A Resilient TCP Socket Client with built-in timeouts, retries, and logging"
22
- spec.files = FileList["./**/*"].exclude('*.gem', 'nbproject').map{|f| f.sub(/^\.\//, '')}
22
+ spec.files = FileList["./**/*"].exclude(/.gem$/, /.log$/,/^nbproject/).map{|f| f.sub(/^\.\//, '')}
23
23
  spec.has_rdoc = true
24
24
  spec.add_dependency 'semantic_logger'
25
25
  end
@@ -546,17 +546,19 @@ module ResilientSocket
546
546
  socket_address = Socket.pack_sockaddr_in(port, address[0][3])
547
547
 
548
548
  begin
549
+ @socket = Socket.new(Socket.const_get(address[0][0]), Socket::SOCK_STREAM, 0)
550
+ @socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) unless buffered
549
551
  begin
550
- @socket = Socket.new(Socket.const_get(address[0][0]), Socket::SOCK_STREAM, 0)
551
- @socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) unless buffered
552
552
  @socket.connect_nonblock(socket_address)
553
553
  rescue Errno::EINPROGRESS
554
- resp = IO.select(nil, [@socket], nil, @connect_timeout)
555
- raise(ConnectionTimeout.new("Timedout after #{@connect_timeout} seconds trying to connect to #{server}")) unless resp
554
+ end
555
+ if IO.select(nil, [@socket], nil, @connect_timeout)
556
556
  begin
557
557
  @socket.connect_nonblock(socket_address)
558
558
  rescue Errno::EISCONN
559
559
  end
560
+ else
561
+ raise(ConnectionTimeout.new("Timedout after #{@connect_timeout} seconds trying to connect to #{server}")) unless resp
560
562
  end
561
563
  break
562
564
  rescue SystemCallError => exception
@@ -1,3 +1,3 @@
1
1
  module ResilientSocket #:nodoc
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resilient_socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-18 00:00:00.000000000 Z
12
+ date: 2012-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: semantic_logger
@@ -47,11 +47,8 @@ files:
47
47
  - nbproject/project.xml
48
48
  - Rakefile
49
49
  - README.md
50
- - resilient_socket-0.2.0.gem
51
- - resilient_socket-0.2.1.gem
52
50
  - test/simple_tcp_server.rb
53
51
  - test/tcp_client_test.rb
54
- - test.log
55
52
  - test.log.working
56
53
  homepage: https://github.com/ClarityServices/resilient_socket
57
54
  licenses: []
Binary file
Binary file
data/test.log DELETED
Binary file