1 person found this helpful
You are doing exactly what was intended in order to create a custom negotiation sequence, although I appreciate that if it is a common enough occurrence to restrict the protocol attempts then perhaps we should expose a property that allows you to do that without subclassing.
How about two properties on NetNegotiator:
defaultProtocolsForRtmp: which defaults to "rtmp,rtmps,rtmpt"
defaultPortsForRtmp: which defaults to "1935,443,80"
This would give you the flexibility to create a custom attempt matrix.
You would still need to subclass NetConnectionFactory to overwrite the createNetNegtiator method to apply your properties, but this would save you from having to subclass NetNegotiator itself.
Let me know if this is what you had in mind or if you think there is a need for something else. Note that it is perfectly fine to connect to rtmp on port 443 without using rtmps (see this example
) so by eliminating rtmps attempts you would reduce your max attempt count from 9 to 6.
My main concern was copy/pasting code from NetNegotiator into the subclass to do a simple customisation of the connection attempt matrix.
Adding the properties you mention would definitely help.