Opened 8 years ago

Last modified 8 years ago

#252 closed task

deprecate tub.listenOn("tcp:0") — at Version 1

Reported by: Brian Warner Owned by:
Priority: major Milestone: 0.12.0
Component: network Version: 0.9.1
Keywords: Cc:

Description (last modified by Brian Warner)

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 (1)

comment:1 Changed 8 years ago by Brian Warner

Description: modified (diff)
Note: See TracTickets for help on using tickets.