Opened 8 years ago

Last modified 8 years ago

#6826 enhancement new

Pass scope IDs and flow info along when receiving datagrams

Reported by: habnabit Owned by:
Priority: normal Milestone:
Component: core Keywords: ipv6
Cc: Branch:


As a followup to #5086, Twisted should pass along the scope ID and flow info for incoming datagrams. #5086 slices these off of the address structure generated when a datagram is received, as code currently expects a 2-tuple.

The implementation that seems most obvious is to, instead of a 2-tuple, return an object that can be iterated over to provide the host and port (so it can be unpacked like a 2-tuple) but has scope_id and flow info attributes.

Change History (2)

comment:1 Changed 8 years ago by Jean-Paul Calderone

Perhaps it's time to start passing something like IPv4Address or IPv6Address as the address to datagramReceived. Shame we didn't start doing this several years ago, then we would have already gone through the deprecation process for treating the address like a two-sequence.

You can find some code in the history of twisted/internet/ that demonstrates the approach we took to this last time.

comment:2 Changed 8 years ago by habnabit

(In [40881]) Merge ipv6-listenUDP-5086-2: Accept IPv6 address literals in IReactorUDP.listenUDP

Authors: marto1_, habnabit, satis Reviewers: exarkun, rwall Fixes: #5086 Refs: #6646, #6647, #6826, #6828

IReactorUDP.listenUDP, IUDPTransport.write and IUDPTransport.connect now accept IPv6 address literals.

Note: See TracTickets for help on using tickets.