Merge pull request #749 from hackrush01/hackrush

Daemon connects even if port 3333 is bound.
This commit is contained in:
Alex Grin 2017-07-12 14:14:42 -04:00 committed by GitHub
commit ead3550588
4 changed files with 10 additions and 4 deletions

View file

@ -9,7 +9,7 @@ at anytime.
## [Unreleased] ## [Unreleased]
### Added ### Added
* * Add link to instructions on how to change the default peer port
* *
### Changed ### Changed
@ -17,8 +17,7 @@ at anytime.
* *
### Fixed ### Fixed
* * peer_port is settable using `settings_set`
*
### Deprecated ### Deprecated
* *

View file

@ -752,6 +752,7 @@ Args:
'data_rate': (float) data rate, 'data_rate': (float) data rate,
'max_key_fee': (float) maximum key fee, 'max_key_fee': (float) maximum key fee,
'download_directory': (str) path of where files are downloaded, 'download_directory': (str) path of where files are downloaded,
'peer_port': (int) port through which daemon should connect,
'max_upload': (float), currently not supported 'max_upload': (float), currently not supported
'max_download': (float), currently not supported 'max_download': (float), currently not supported
'download_timeout': (int) download timeout in seconds 'download_timeout': (int) download timeout in seconds

View file

@ -604,6 +604,7 @@ Args:
'data_rate': (float) data rate, 'data_rate': (float) data rate,
'max_key_fee': (float) maximum key fee, 'max_key_fee': (float) maximum key fee,
'download_directory': (str) path of where files are downloaded, 'download_directory': (str) path of where files are downloaded,
'peer_port': (int) port through which daemon should connect,
'max_upload': (float), currently not supported 'max_upload': (float), currently not supported
'max_download': (float), currently not supported 'max_download': (float), currently not supported
'download_timeout': (int) download timeout in seconds 'download_timeout': (int) download timeout in seconds

View file

@ -310,10 +310,12 @@ class Daemon(AuthJSONRPCServer):
self.session.peer_manager) self.session.peer_manager)
try: try:
log.info("Daemon bound to port: %d", self.peer_port)
self.lbry_server_port = reactor.listenTCP(self.peer_port, server_factory) self.lbry_server_port = reactor.listenTCP(self.peer_port, server_factory)
except error.CannotListenError as e: except error.CannotListenError as e:
import traceback import traceback
log.error("Couldn't bind to port %d. %s", self.peer_port, traceback.format_exc()) log.error("Couldn't bind to port %d. Visit lbry.io/faq/how-to-change-port for more details.", self.peer_port)
log.error("%s", traceback.format_exc())
raise ValueError("%s lbrynet may already be running on your computer.", str(e)) raise ValueError("%s lbrynet may already be running on your computer.", str(e))
return defer.succeed(True) return defer.succeed(True)
@ -419,6 +421,7 @@ class Daemon(AuthJSONRPCServer):
'download_directory': str, 'download_directory': str,
'data_rate': float, 'data_rate': float,
'download_timeout': int, 'download_timeout': int,
'peer_port': int,
'max_key_fee': dict, 'max_key_fee': dict,
'use_upnp': bool, 'use_upnp': bool,
'run_reflector_server': bool, 'run_reflector_server': bool,
@ -1109,6 +1112,7 @@ class Daemon(AuthJSONRPCServer):
settings_set [<download_directory> | --download_directory=<download_directory>] settings_set [<download_directory> | --download_directory=<download_directory>]
[<data_rate> | --data_rate=<data_rate>] [<data_rate> | --data_rate=<data_rate>]
[<download_timeout> | --download_timeout=<download_timeout>] [<download_timeout> | --download_timeout=<download_timeout>]
[<peer_port> | --peer_port=<peer_port>]
[<max_key_fee> | --max_key_fee=<max_key_fee>] [<max_key_fee> | --max_key_fee=<max_key_fee>]
[<use_upnp> | --use_upnp=<use_upnp>] [<use_upnp> | --use_upnp=<use_upnp>]
[<run_reflector_server> | --run_reflector_server=<run_reflector_server>] [<run_reflector_server> | --run_reflector_server=<run_reflector_server>]
@ -1122,6 +1126,7 @@ class Daemon(AuthJSONRPCServer):
<download_directory>, --download_directory=<download_directory> : (str) <download_directory>, --download_directory=<download_directory> : (str)
<data_rate>, --data_rate=<data_rate> : (float), 0.0001 <data_rate>, --data_rate=<data_rate> : (float), 0.0001
<download_timeout>, --download_timeout=<download_timeout> : (int), 180 <download_timeout>, --download_timeout=<download_timeout> : (int), 180
<peer_port>, --peer_port=<peer_port> : (int), 3333
<max_key_fee>, --max_key_fee=<max_key_fee> : (dict) maximum key fee for downloads, <max_key_fee>, --max_key_fee=<max_key_fee> : (dict) maximum key fee for downloads,
in the format: { in the format: {
"currency": <currency_symbol>, "currency": <currency_symbol>,