thanks about the info on createObjRefMoniker.
using :
RuntimeServices.Marshal() and then unmarshal it in the worker thread using
RuntimeServices.UnMarshal() and then call the method on server
sounds like the coorect equivalent of what you had to do on native code , so
i think you are in the correct path
however, another option i think of is to use the GIT (global interface
table) to (marshal once, get a token, unmarshal (many times) using the
token)
btw , did you solve
------
System.Runtime.Remoting.RemotingException: This remoting proxy has no
channel sink which means either the server has no registered server channels
that are listening, or this application has no suitable client channel to
talk to the server."
------
dropping
ChannelServices.RegisterChannel (new TcpChannel(0));
on the client side ?
"Catherine Jones" <no*@moreply.com> wrote in message
news:u3*************@tk2msftngp13.phx.gbl...
Hello Enrico
Firstly thanks a lot for all your help and time.
I really appreciate that you are following up with me here.
Please help me resolve the issue.
We're making an MTA thread ( by default all the worker threads are MTA ) and
there by we are marshalling our com object in this thread using
RuntimeServices.Marshal() and then unmarshal it in the worker thread using
RuntimeServices.UnMarshal() and then call the method on server
passing this marshalled object.So what happens is that the Trasparent Proxy
object lies with the main thread whereas the servercall goes on the child
thread.
We prototyped it and it seems to work fine.
createObjRefMoniker :
Well in this case we create a named moniker of our com object and pass that
name to server instead of the object itself, now using this name we get the
com object reference on server and call the method on this.
Regards
Catherine
"enrico sabbadin @ infinito" <sabbadin@infinito_xyz.it> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
I've faced the problem in a message brokering system. In this case I put
the message in a .net queue , where another thread picks it up and deliver the
message. Using async delegate or the trhead pool is not an option if you
need to guarantee message / method call delivery order
I've never used createObjRefMoniker , will you elaborate on this option ?
"Catherine Jones" <no*@moreply.com> wrote in message
news:ez**************@TK2MSFTNGP12.phx.gbl... Hi Enrico
Thanks for your time.
Although I'm able to find the issue related to hanging problem
( it was due to reentrancy problem ),
I come up to two solutions for this problem to solve:
1. Is to span a new worker thread
2. to use Moniker ( using the api createObjRefMoniker )
I just want your input on, if using createObjRefMoniker is safe ?
Regards.
"enrico sabbadin @ infinito" <sabbadin@infinito_xyz.it> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
drop
ChannelServices.RegisterChannel (new TcpChannel(0));
on startup in the "process" throwing the exception.
about hanging .. you might be facing an STA thread lock due to reentrancy .. have a look at this
http://www.dotnetremoting.cc/FAQs/Ha...pplication.asp (the link might be invalid, ingo site has moved if i rememebr well)
you can download from here
(http://www.codearchitects.com/casubs...n/default.aspx) a message
brokering system implemented in .net remoting which shows how to
handle correctly the above mentioned issues.
p.s.: i think you should avoid passing com objects across machine and
process boundaries .. you are asking for troubles ..
there are security issues and marshaling implementatin bugs for some -
execution flow/object type passed - patterns
IMO
"Catherine Jones" <no*@moreply.com> wrote in message
news:#Y**************@TK2MSFTNGP10.phx.gbl...
> Hi all, we need urgent help in a matter.
>
> We are trying to pass a COM object from the client to server and are
>
> facing some problems in the same.
>
> We've our client in C# as well as the Server in C# and we're using
>
> remoting for client to server communication.
>
> Out client first creates an object of type System.__ComObject and
>
> then passes it to our server using remoting, the
>
> scenario can be visualized as :-
>
>
>
> Com Server
>
> Component A Exposing Interface IA and IB
>
> C# Client
>
> Type comType = Type.GetTypeFromCLSID( CLSID_A )
>
> object objDisp = Activator.CreateInstance( comType );
>
> TcpChannel chnl = new TcpChannel( 8086 );
>
> ChannelServices.RegisterChannel( chnl );
>
> //Through Reflection now we call a method on this IA which returns
>
> Dispatch of IB ( in C# we get this as System.__ComObject )
>
> Now we're creating a CAO for our component CSA and call the method
>
> which expects as parameter the System.__ComObject Created earlier
>
> RemotingConfiguration.RegisterActivatedClientType( typeof( CSA ),
>
> "tcp://8085" );
>
> CSA objCSA = new CSA.CSA();
>
> objCSA.getSomething( objDisp );
>
>
>
>
>
>
>
>
>
> C# Assembly
>
> Component CSA
>
>
>
>
>
> protected object m_objSess;
>
> CSA::getSomething( objDisp )
>
> {
>
> m_objSess = objDisp;
>
> //Now using reflection we call a method of this
>
> System.__ComObject passed as parameter
>
>
> }
>
>
>
>
>
>
>
> C# Server
>
> BinaryServerFormatterSinkProvider prov = new
>
> BinaryServerFormatterSinkProvider();
>
> prov.TypeFilterLevel = TypeFilterLevel.Full;
>
>
> IDictionary prop = new HashTable();
>
>
> prop["port"] = 8085;
>
> TcpChannel chnl = new TcpChannel( prop, null, prov );
>
> ChannelServices.RegisterChannel( chnl );
>
> RemotingConfiguration.RegisterActivatedServiceType ( typeof( CSA ) );
>
>
>
> System.Console.Readline();
>
>
>
>
>
>
> Now on executing the code ,at line marked in red it throws an
>
> exception telling that "System.Runtime.Remoting.RemotingException:
This >
> remoting proxy has no channel sink which means either the server has
>
> no registered server channels that are listening, or this
application has >
> no suitable client channel to talk to the server."
>
> To remove this we opened a bi-directional ( as shown in the code
>
> with blue color ) channel but when we do this the call hangs ( does
not come
>
> out ) from the line marked in red ( while invoking the method using
>
> reflection ).
>
>
>
> Could you please throw some light on the missing snippets of code if
>
> any and provide us some guideline as to how to proceed to make the calls >
> successful.
>
> Thanks a lot for your time!
>
>