statsd-client 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/statsd.rb +9 -4
  2. metadata +2 -2
data/lib/statsd.rb CHANGED
@@ -2,7 +2,7 @@ require 'socket'
2
2
 
3
3
  class Statsd
4
4
 
5
- Version = '0.0.2'
5
+ Version = '0.0.3'
6
6
 
7
7
  class << self
8
8
 
@@ -50,9 +50,14 @@ class Statsd
50
50
 
51
51
  raise "host and port must be set" unless host && port
52
52
 
53
- sock = UDPSocket.new
54
- data.each do |d|
55
- sock.send(d, 0, host, port)
53
+ begin
54
+ sock = UDPSocket.new
55
+ data.each do |d|
56
+ sock.send(d, 0, host, port)
57
+ end
58
+ rescue # silent but deadly
59
+ ensure
60
+ sock.close
56
61
  end
57
62
  true
58
63
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben VandenBos