We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fddc152 + 2e9a247 commit b13fa3fCopy full SHA for b13fa3f
kafka/conn.py
@@ -149,7 +149,5 @@ def reinit(self):
149
Re-initialize the socket connection
150
"""
151
self.close()
152
- self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
153
- self._sock.settimeout(self.timeout)
154
- self._sock.connect((self.host, self.port))
+ self._sock = socket.create_connection((self.host, self.port), self.timeout)
155
self._dirty = False
0 commit comments