summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gstatsd/sink.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/gstatsd/sink.py b/gstatsd/sink.py
index 8d51a32..cf32927 100644
--- a/gstatsd/sink.py
+++ b/gstatsd/sink.py
@@ -100,8 +100,7 @@ class GraphiteSink(Sink):
for host in self._hosts:
# flush stats to graphite
try:
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.connect(host)
+ sock = socket.create_connection(host)
sock.sendall(buf.getvalue())
sock.close()
except Exception, ex: