java.net package - Override UDP transport
问题 I need to override the default implementation of DatagramSocket transport i.e., PlainDatagramSocketImpl and I found that java provides a way to do this via DatagramSocketImplFactory class. However my requirement is to use my own class for a very specific case and to use the default UDP socket transport for all other cases. Essentially adding an if-else clause in SocketFactory class which will instantiate my class if a condition is met, else instantiate the default transport. My dilemma is