mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Close socket on connection failure.
This commit is contained in:
parent
ce79230173
commit
2261b325ab
1 changed files with 3 additions and 0 deletions
|
|
@ -469,6 +469,9 @@ def createSocket(self):
|
|||
self.retryTime = None # next time, no delay before trying
|
||||
except socket.error:
|
||||
#Creation failed, so set the retry time and return.
|
||||
if self.sock is not None:
|
||||
self.sock.close()
|
||||
self.sock = None
|
||||
if self.retryTime is None:
|
||||
self.retryPeriod = self.retryStart
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue