Fix bug 1889255: wireless TCP port upper limit is 32000 only

This commit is contained in:
Charles Haley 2020-07-28 16:23:04 +01:00
parent 12c14b491f
commit c686bf212d
2 changed files with 5 additions and 5 deletions

View File

@ -1931,7 +1931,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
while i < 100: # try 9090 then up to 99 random port numbers
i += 1
port = self._attach_to_port(self.listen_socket,
9090 if i == 1 else random.randint(8192, 32000))
9090 if i == 1 else random.randint(8192, 65525))
if port != 0:
break
if port == 0:

View File

@ -57,7 +57,7 @@ class SmartdeviceDialog(QDialog, Ui_Dialog):
self.fixed_port.setToolTip('<p>' +
_('Try 9090. If calibre says that it fails to connect '
'to the port, try another number. You can use any number between '
'8,000 and 32,000.') + '</p>')
'8,000 and 65,535.') + '</p>')
self.ip_addresses.setToolTip('<p>' +
_('These are the IP addresses for this computer. If you decide to have your device connect to '
@ -116,12 +116,12 @@ class SmartdeviceDialog(QDialog, Ui_Dialog):
port = int(port)
except:
error_dialog(self, _('Invalid port number'),
_('The port must be a number between 8000 and 32000.'), show=True)
_('The port must be a number between 8000 and 65535.'), show=True)
return
if port < 8000 or port > 32000:
if port < 8000 or port > 65535:
error_dialog(self, _('Invalid port number'),
_('The port must be a number between 8000 and 32000.'), show=True)
_('The port must be a number between 8000 and 65535.'), show=True)
return
self.device_manager.set_option('smartdevice', 'password',