split error for unable to bind to port
This commit is contained in:
parent
6621657ccc
commit
c24351d58f
|
@ -480,12 +480,13 @@ class ClientZeroconf:
|
|||
def connect(self, show, msg):
|
||||
self.port = self.start_listener(self.caller.port)
|
||||
if not self.port:
|
||||
return
|
||||
return False
|
||||
self.zeroconf_init(show, msg)
|
||||
if not self.zeroconf.connect():
|
||||
self.disconnect()
|
||||
return
|
||||
return None
|
||||
self.roster = roster_zeroconf.Roster(self.zeroconf)
|
||||
return True
|
||||
|
||||
def remove_announce(self):
|
||||
if self.zeroconf:
|
||||
|
|
|
@ -218,11 +218,16 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
|
|||
_('Please check if Avahi is installed.')))
|
||||
self.disconnect()
|
||||
return
|
||||
self.connection.connect(show, msg)
|
||||
if not self.connection.listener:
|
||||
result = self.connection.connect(show, msg)
|
||||
if not result:
|
||||
self.dispatch('STATUS', 'offline')
|
||||
self.status = 'offline'
|
||||
self.dispatch('CONNECTION_LOST',
|
||||
if result is False:
|
||||
self.dispatch('CONNECTION_LOST',
|
||||
(_('Could not start local service'),
|
||||
_('Unable to bind to port %d.' % self.port)))
|
||||
else: # result is None
|
||||
self.dispatch('CONNECTION_LOST',
|
||||
(_('Could not start local service'),
|
||||
_('Please check if avahi-daemon is running.')))
|
||||
self.disconnect()
|
||||
|
|
Loading…
Reference in New Issue