Hi.

I said I would research the possiblity of changing the socket factory by a custom one that would produce sockets capable of measuring times below the HTTP level (connection establishment, write time, latency, read time).

To do this, I needed to subclass, encapsulate, or reimplement the java.net.PlainSocketImpl class.
- Subclassing or encapsulating is not possible because the class has package visibility and it is illegal for common mortals to create classes in java.net.
- Reimplementing (by copying PlainSocketImpl source) is a bad solution, since that class uses native methods heavily and thus the reimplementation would likely be good only for one single JVM version. In adition, it is difficult because the original implementation subclasses java.net.SocketImpl and uses protected member variables in that class -- so I would need to partially reimplement SocketImpl too.


To make things even worse, there's no such thing as a default SocketImplFactory: in the default configuration, the java.net.Socket class creates socket implementations directly (without going through a factory).

In short: java.net was not designed to be extensible by common mortals, and a Real Java Programmer(tm) is needed for the job :-)

If you can come up with an idea to solve this (other than repackaging rt.jar -- that is too dirty even for me), I'll be happy to explore it.

--
Salut,

Jordi.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to