Skip to content
Snippets Groups Projects
Commit c24351d5 authored by dkirov's avatar dkirov
Browse files

split error for unable to bind to port

parent 6621657c
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment