Overriding Socket Implementation
843790May 9 2008 — edited Jun 26 2008Few threads were already opened for this question, but I found none with the answer.
How do I overide default Socket implementation?
I want:
- to be responsible of the creation of every new Socket (or SocketImpl)
to be able to provide my own Socket implementation.
I want my socket implementation:
- to be built above the default socket implementation.
- to provide getInputStream() and getOutputStream() methods
that return a FilterInputStream and FilterOutputStream
which would refer to the Socket's input and output streams.
I see Socket.setSocketImplFactory() allow to set the default SocketImplFactory,
but I don't know how to get the default one nor how to build default SocketImpl.
Thanks for your help.