try to connect to next type when connection is refused (server not listening on 5223)

This commit is contained in:
Yann Leboulanger 2008-10-22 19:59:14 +00:00
parent 7ca670a303
commit 4a06659912
1 changed files with 6 additions and 1 deletions

View File

@ -472,7 +472,12 @@ class NonBlockingTcp(PlugIn, IdleObject):
return return
if received is None: if received is None:
if errnum != 0: if self.state == 0 and errnum == errno.ECONNREFUSED:
# We tried to connect to a port that did't listen.
log.error("Connection to %s refused: %s [%d]", self.getName(), errtxt, errnum)
self.pollend(retry=True)
return
elif errnum != 0:
self.DEBUG(errtxt, 'error') self.DEBUG(errtxt, 'error')
log.error("Connection to %s lost: %s [%d]", self.getName(), errtxt, errnum) log.error("Connection to %s lost: %s [%d]", self.getName(), errtxt, errnum)
self._owner.disconnected() self._owner.disconnected()