[PATCH] DefaultSocketImplFactory
Christopher Hegarty - Sun Microsystem
Christopher.Hegarty at Sun.COM
Tue Mar 11 07:35:43 PDT 2008
Hi Roman,
This is clearly legacy code but I can see that DatagramSocket has such a
property. I don't see any problem adding a property, I suppose I just
question it's usefulness. If it is something that you think we really be
useful then maybe you could flesh out the implementation (including
ServerSocket) and a simple test.
-Chris.
Roman Kennke wrote:
> Hi,
>
> I'm trying to port the network code to the JamaicaVM. It appears that
> the PlainSocketImpl (or its subclass SocksSocketImpl) that is used by
> default in java.net.Socket is not really feasible to use as SocketImpl,
> and I would rather be able to choose different implementations for some
> platforms. However, the choice of SocksSocketImpl is hardwired in the
> Socket class. I propose to do something similar as in DatagramSocket and
> InetAddress, and choose the implementation based on the property
> impl.prefix, using a factory class.
>
> The exact name of the property might be different though, otherwise we
> might introduce a small incompatibility, when somebody uses the
> impl.prefix property (or is it used internally? that would be even
> worse) then he would now also have to provide a SocketImpl for that
> prefix. Maybe we should choose 'socketimpl.prefix' then?
>
> What do you think, is such a change feasible? It would certainly make my
> life a lot easier.
>
> Cheers, Roman
>
>
More information about the net-dev
mailing list