[This is preliminary documentation and subject to change.]
When you open a tunnel session in WSend it calls the OnOpenTunnel function. This function opens a tunnel to the MMR and, if the tunnel opens without error, starts a thread that sends data through the tunnel. The OnCloseTunnel function stops the transfer by setting an abort event, waiting for the thread to process the abort event, and shutting down the thread.
The TunnelWorkerThread function is nearly identical to the MulticastWorkerThread function. The difference is that the send function in BandwidthThrottleSend uses a tunnel to send the data to the MMR instead of broadcasting multicast packets.