mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 03:06:33 +00:00
use listenOnUnused instead of allocate_tcp_port in create_control_tub
This commit is contained in:
parent
9a30eaa83c
commit
6ea1684995
@ -680,12 +680,8 @@ def create_control_tub():
|
|||||||
port or location
|
port or location
|
||||||
"""
|
"""
|
||||||
control_tub = Tub()
|
control_tub = Tub()
|
||||||
portnum = iputil.allocate_tcp_port()
|
portnum = iputil.listenOnUnused(control_tub)
|
||||||
port = "tcp:%d:interface=127.0.0.1" % portnum
|
log.msg("Control Tub location set to 127.0.0.1:%s" % (portnum,))
|
||||||
location = "tcp:127.0.0.1:%d" % portnum
|
|
||||||
control_tub.listenOn(port)
|
|
||||||
control_tub.setLocation(location)
|
|
||||||
log.msg("Control Tub location set to %s" % (location,))
|
|
||||||
return control_tub
|
return control_tub
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user