[Mono-list] Feature Request: Dynamic Loading and Preloading
Dwivedi , Ajay Kumar
AjayKumar.Dwivedi@dresdner-bank.com
Fri, 4 Jan 2002 16:02:03 -0000
hi all,
A have a few queries and feature Requests in mind regarding the
loading of assembiles/classes. I have no idea how easy or hard it may
be to implement these or if these are already implemented.
classpath?
* Does CLR allow something like classpath ?
From what I gathered from the docs is that CLR allows a config
file for each executable which can be used to specify how to load
the assemblies. But assemblies are a collection of classes. What
if I want to provide a different implementation for a single class
in the assembly.
* Will mono support LD_PRELOAD ;-)
As we all know LD_PRELOAD is a very powerful feature of unices.
I wish to retain this feature in mono CLR.
* Can we ask the runtime to locate and use the next assembly/whatever
instead of the one it has already found.
As a simple example I would like to do the following:
I have a precompiled executable which uses System.Console to
WriteLine()
However I would like it use another class written by me which has the
WriteLine()
modified such that it writes to both Console and some file. ( I could have
used
tee, but I just want it do work this way ;-)
As a complicated example :
I have a precompiled executable which uses System.Net.TcpClient to
connect
to some server. But I am behind a proxy and the application does not support
proxies.
So I write a function System.Net.TcpClient.Connect(IPAddress host,int port).
In this
function I use the next instance of Connect (which is in the System
Assembly) to
connect to the proxy and then return some commands to the proxy to connect
me to
the requested host and port. Once the connection is established, I return
from my
function. The application never comes to know it is connecting through a
proxy. Using
this I can use applications which do not support proxies to work behind
proxy.
I have an implementation of the second example in C at
http://sourceforge.net/projects/transconnect .
Regards,
Ajay