Opened 9 years ago
Closed 9 years ago
#252 closed task (fixed)
deprecate tub.listenOn("tcp:0")
Reported by: | Brian Warner | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.12.0 |
Component: | network | Version: | 0.9.1 |
Keywords: | Cc: |
Description (last modified by )
We're moving towards less auto-magic allocation/detection and more pre-allocated ports and user-supplied hostnames/IP-addresses. The practice of automatically detecting locally-attached interfaces only works when the other machine you're talking to is on the same network (and with NAT, this is usually not true). And the automatic detection makes things less predictable.
So the plan is to deprecate the following:
Listener.getPortnum()
tub.setLocationAutomatically()
tub.listenOn("tcp:0")
. Or rather, you could still do that, but without.getPortnum()
there's no way to find out the port that got allocated. So you should always choose the port number first.- #137 is WONTFIXed, which would have added
Tub.listenOn(portfile=)
- #138 is WONTFIXed, which would have added
d=Tub.whenReady()
, which should no longer be necessary when we stop waiting for ports to be allocated
And we're adding foolscap.util.allocate_tcp_port()
(which doesn't block) to help applications perform the allocation ahead of time.
Change History (4)
comment:1 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 9 years ago by
comment:3 Changed 9 years ago by
One note: Listener is becoming smaller right now (pieces of its API are being deprecated). But it might get bigger again in the future. I'm still interested in having a single TCP port accept both HTTP and Foolscap connections, and in a "redirect" Tub lookup, and I think both features will involve creating a standalone Listener, tweaking it somehow, then submitting it to Tub.listenOn(mylistener)
. The ability to do that was removed a while ago, but that doesn't mean it won't come back some day.
comment:4 Changed 9 years ago by
Milestone: | eventually → 0.12.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Landed in [5946155].
I'm working on the code for this, and it requires some UI changes to the foolscap tools:
flappserver create
now requires--location=
.flogtool create-gatherer
andcreate-incident-gatherer
both require new--location=
argumentsThe process is educational: I'm learning what sorts of changes will be required of Tahoe when this lands.