Telling us what you are trying to do could hep to raise better suggestions
(for example my first thought would be to just wrap the needed functionality
into my own function but as we don't know what you are trying to do I'm not
sure why the "substitute a method" requirement is needed)...
---
Patrice
> Hi,
>
[quoted text clipped - 5 lines]
>
> Alexei.
lioxa - 30 Aug 2007 12:22 GMT
I need to alter functionality of Remoting TcpChannel. I cannot access
target class (transport sink) because it is 'internal'. And
SetupChannel method of TcpChannel class (which I would override to
create my own transport sink, instead of default sink it creates) is
private.
Substituting couple private methods from internal Remoting assembly
classes with my own would help. :)
> Telling us what you are trying to do could hep to raise better suggestions
> (for example my first thought would be to just wrap the needed functionality
[quoted text clipped - 16 lines]
>
> > Alexei.
Patrice - 30 Aug 2007 13:00 GMT
Not familiar but I gave a look and saw that you can apparently use a
contructor to which you can provide your own sink provider as a
IClientChannelSinkProvider, IServerChannelSinkProvider.
If methods are internal and it doesn't fit you are basically stuck with
recompiling your own version (or you could have a look at WCF that could
offer more flexibility depending on your overall goal).
Good luck.
---
Patrice
>I need to alter functionality of Remoting TcpChannel. I cannot access
> target class (transport sink) because it is 'internal'. And
[quoted text clipped - 28 lines]
>>
>> > Alexei.
lioxa - 30 Aug 2007 14:23 GMT
Thanks for suggestions, but first isnt possible (transport sinks are
hardcoded), and second (WCF) is .NET 3.0 - I'd prefer to stick to
2.0.
I'm almost sure that with enough permissions I can do what I need -
substitute a framework clas/method with my own (of course in
particular framework instance loaded into my process).
Initial question was - how. :) I see an example in MSDN on how to
attach my own method to any class in runtime (using Reflection),
probably someone familiar with this subject can give me a clue how to
substitute existing method.
> Not familiar but I gave a look and saw that you can apparently use a
> contructor to which you can provide your own sink provider as a
[quoted text clipped - 44 lines]
>
> >> > Alexei.
lioxa - 30 Aug 2007 12:25 GMT
I need to alter functionality of Remoting TcpChannel (in particular,
its transport sink), which is implemented in 'internal' classes and
'private' methods.
Substituting couple classes or methods in this assembly with my own
would help. :)
> Telling us what you are trying to do could hep to raise better suggestions
> (for example my first thought would be to just wrap the needed functionality
[quoted text clipped - 16 lines]
>
> > Alexei.