Skip to content

Commit

Permalink
Be more specific when calling getaddrinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
gmr committed Apr 29, 2015
1 parent 1567ba3 commit d235989
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pika/adapters/base_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def _adapter_connect(self):
"""
# Get the addresses for the socket, supporting IPv4 & IPv6
try:
addresses = socket.getaddrinfo(self.params.host, self.params.port, 0, socket.SOCK_STREAM)
addresses = socket.getaddrinfo(self.params.host, self.params.port,
0, socket.SOCK_STREAM,
socket.IPPROTO_TCP)
except socket.error as error:
LOGGER.critical('Could not get addresses to use: %s (%s)', error,
self.params.host)
Expand Down

0 comments on commit d235989

Please sign in to comment.