mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Make bonjour errors in the wireless driver non-fatal.
This commit is contained in:
parent
8bbfc19472
commit
b2ec03c7d5
@ -1276,30 +1276,28 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
|
|||||||
'_calibresmartdeviceapp._tcp', port, {},
|
'_calibresmartdeviceapp._tcp', port, {},
|
||||||
use_ip_address=ip_addr)
|
use_ip_address=ip_addr)
|
||||||
except:
|
except:
|
||||||
message = 'registration with bonjour failed'
|
self._debug('registration with bonjour failed')
|
||||||
self._debug(message)
|
traceback.print_exc()
|
||||||
self._close_listen_socket()
|
|
||||||
return message
|
|
||||||
|
|
||||||
self._debug('listening on port', port)
|
self._debug('listening on port', port)
|
||||||
self.port = port
|
self.port = port
|
||||||
|
|
||||||
# Now try to open a UDP socket to receive broadcasts on
|
# Now try to open a UDP socket to receive broadcasts on
|
||||||
|
|
||||||
|
message = None
|
||||||
try:
|
try:
|
||||||
self.broadcast_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
self.broadcast_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
except:
|
except:
|
||||||
message = 'creation of broadcast socket failed. This is not fatal.'
|
message = 'creation of broadcast socket failed. This is not fatal.'
|
||||||
self._debug(message)
|
self._debug(message)
|
||||||
return message
|
self.broadcast_socket = None
|
||||||
|
else:
|
||||||
for p in self.BROADCAST_PORTS:
|
for p in self.BROADCAST_PORTS:
|
||||||
port = self._attach_to_port(self.broadcast_socket, p)
|
port = self._attach_to_port(self.broadcast_socket, p)
|
||||||
if port != 0:
|
if port != 0:
|
||||||
self._debug('broadcast socket listening on port', port)
|
self._debug('broadcast socket listening on port', port)
|
||||||
break
|
break
|
||||||
|
|
||||||
message = None
|
|
||||||
if port == 0:
|
if port == 0:
|
||||||
self.broadcast_socket.close()
|
self.broadcast_socket.close()
|
||||||
self.broadcast_socket = None
|
self.broadcast_socket = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user