SocketImplFactory

Alan Bateman Alan.Bateman at oracle.com
Fri Apr 19 04:26:35 PDT 2013


On 18/04/2013 22:31, Salter, Thomas A wrote:
> Are there any real-life examples of using SocketImplFactory?
>
> I was hoping to find a way to redirect selected sockets, by IP address, to a different implementation of sockets that could take advantage of a high-speed connection.  For this to work, I'd need to be able to delegate all other sockets back to the standard implementation.  Unfortunately, it appears that most of the classes I'd need to access are package-private so this approach wouldn't work.
>
> A requirement is that applications would not require any source changes.  They would be unmodified and just have things redirect dynamically when they create a Socket or ServerSocket.  I was thinking that this feature would be enabled through a class that loads as a service and calls setSocketFactory.
>
> Inheriting from Socket or ServerSocket doesn't help since I can't change the applications and I can't make those classes revert to the default implementation when I don't want to use mine.
>
> Is there any hope of something like this working?
>
>
I can't point to specific examples but SocketImplFactory is somewhat 
legacy now. It was used quite a bit in the early days but personally I 
haven't seen any usages in the last few yeas.

-Alan.



More information about the net-dev mailing list