RebindingTransport
class RebindingTransport(val first: InMemoryTransport, val second: InMemoryTransport, val switchAt: Int, val oldAddressReceives: Boolean = true) : DatagramTransport(source)
A DatagramTransport whose source address changes in the middle of a conversation, as a NAT rebinding does to a client behind it: datagrams go out from first until switchAt of them were sent, and from second after that, so the peer sees the later ones come from another address. Datagrams arrive on both addresses, unless oldAddressReceives is false: then whatever reaches first after the switch is lost, as when the old NAT binding has expired.
val client = RebindingTransport(network.attach(), network.attach(), switchAt = 5)Content copied to clipboard
close closes both transports.
Constructors
Link copied to clipboard
constructor(first: InMemoryTransport, second: InMemoryTransport, switchAt: Int, oldAddressReceives: Boolean = true)