Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Overriding Socket Implementation

843790May 9 2008 — edited Jun 26 2008
Few 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2008
Added on May 9 2008
17 comments
418 views