Hi Scott,
I had thought about that. Of course the
methods would need to be made thread safe.
First I though about an additional class
like StunClientHandler that you could pass with the
AddTransport method. But it would impose
the exact same problems, and stun server is
integrated into UdpTransport anyway, so
this wouldn't make much sense.
Making the transaction controller handle
not only SIP messages but also stun
requests and responses (and possibly make
them even travel through dum)
sounds like a lot of work.
If the application would create a custom
transport object and use the other AddTransport
method, we have the same result already,
that the application has a reference to a
transport. So we would not create any new
behaviour. After all it is the application that
is responsible for adding transports and
thus for knowing about the validity of the transport
pointer.
If you are planning for the ability to
remove transports, this could be even a benefit, because
you could do just the following to
temporarily disable a transport:
Transport myTransport =
stack.AddTransport(....);
//remove transport
stack.RemoveTransport(myTransport);
//re-add