Skip to content

Commit

Permalink
[dogstatsd] sock.setblocking(0) for UDP socket (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
prognant committed Oct 2, 2020
1 parent 32a3045 commit 7c91aeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datadog/dogstatsd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ def get_socket(self):
if not self.socket:
if self.socket_path is not None:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
sock.connect(self.socket_path)
sock.setblocking(0)
sock.connect(self.socket_path)
self.socket = sock
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setblocking(0)
sock.connect((self.host, self.port))
self.socket = sock

Expand Down

0 comments on commit 7c91aeb

Please sign in to comment.