[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Can I pass a CAO to an SAO?

Sam Santiago

7/16/2004 8:18:00 PM

Is it possible to pass on ObjRef that I have obtained for a CAO to an SAO to use as a parameter in a procedure or function? Do I have to control the marshaling of this parameter or will .NET be able to handle it?

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
4 Answers

Bob Rundle

7/17/2004 4:52:00 PM

0

Absolutely you can do this. You will need set up a server channel in the client so the server can communicate witht the client's object.
"Sam Santiago" <ssantiago@n0spam-SoftiTechture.com> wrote in message news:uz$P0H3aEHA.716@TK2MSFTNGP11.phx.gbl...
Is it possible to pass on ObjRef that I have obtained for a CAO to an SAO to use as a parameter in a procedure or function? Do I have to control the marshaling of this parameter or will .NET be able to handle it?

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com

Sam Santiago

7/18/2004 11:33:00 PM

0

Any links or examples you can point to? I am not sure what your intent would be with creating a server channel in the client.
Here's the envisioned scenario. I have two machines ClientPC and ServerPC. The possible sequence of events is:

1) ClientPC creates an a reference to a well-known SAO (singleton) living on ServerPC.
2) ClientPC creates a reference to a CAO living on ServerPC as well.
3) ClientPC executes a method on SAO that would take the ObjRef to the CAO as a parameter.

So both objects are residing on ServerPC and the ClientPC has a reference to each. Can the ClientPC pass CAO reference as a parameter to SAO so that SAO can use the same CAO the client holds a reference to.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
"Bob Rundle" <rundle@rundle.com> wrote in message news:%23VMRY5BbEHA.2408@tk2msftngp13.phx.gbl...
Absolutely you can do this. You will need set up a server channel in the client so the server can communicate witht the client's object.
"Sam Santiago" <ssantiago@n0spam-SoftiTechture.com> wrote in message news:uz$P0H3aEHA.716@TK2MSFTNGP11.phx.gbl...
Is it possible to pass on ObjRef that I have obtained for a CAO to an SAO to use as a parameter in a procedure or function? Do I have to control the marshaling of this parameter or will .NET be able to handle it?

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com

Bob Rundle

7/19/2004 12:55:00 PM

0

The server channel in the client is necessary so that the server can communicate back to the client to access the CAO. Its not that strange when you think about it. A CAO is, at least in my way of thinking, by definition living on the client.

If what you are talking about is getting a remote reference from the server and then passing it back to the server through another method call, then certainly you can do this also. I'm not sure whether you need a server channel in the client in this case.

The best example of these bi-directional communication that I have seen is Sunny's event wrapper sample which have been posted recently to this newsgroups. See the "Remoting events" topic.

Regards,
Bob Rundle


"Sam Santiago" <ssantiago@n0spam-SoftiTechture.com> wrote in message news:uf%23UC%23RbEHA.3944@tk2msftngp13.phx.gbl...
Any links or examples you can point to? I am not sure what your intent would be with creating a server channel in the client.
Here's the envisioned scenario. I have two machines ClientPC and ServerPC. The possible sequence of events is:

1) ClientPC creates an a reference to a well-known SAO (singleton) living on ServerPC.
2) ClientPC creates a reference to a CAO living on ServerPC as well.
3) ClientPC executes a method on SAO that would take the ObjRef to the CAO as a parameter.

So both objects are residing on ServerPC and the ClientPC has a reference to each. Can the ClientPC pass CAO reference as a parameter to SAO so that SAO can use the same CAO the client holds a reference to.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
"Bob Rundle" <rundle@rundle.com> wrote in message news:%23VMRY5BbEHA.2408@tk2msftngp13.phx.gbl...
Absolutely you can do this. You will need set up a server channel in the client so the server can communicate witht the client's object.
"Sam Santiago" <ssantiago@n0spam-SoftiTechture.com> wrote in message news:uz$P0H3aEHA.716@TK2MSFTNGP11.phx.gbl...
Is it possible to pass on ObjRef that I have obtained for a CAO to an SAO to use as a parameter in a procedure or function? Do I have to control the marshaling of this parameter or will .NET be able to handle it?

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com

Sunny

7/19/2004 2:33:00 PM

0

Hi,

In article <uf#UC#RbEHA.3944@tk2msftngp13.phx.gbl>, ssantiago@n0spam-
SoftiTechture.com says...
> Any links or examples you can point to? I am not sure what your intent would be with creating a server channel in the client.
> Here's the envisioned scenario. I have two machines ClientPC and ServerPC. The possible sequence of events is:
>
> 1) ClientPC creates an a reference to a well-known SAO (singleton) living on ServerPC.
> 2) ClientPC creates a reference to a CAO living on ServerPC as well.
> 3) ClientPC executes a method on SAO that would take the ObjRef to the CAO as a parameter.
>
> So both objects are residing on ServerPC and the ClientPC has a reference to each. Can the ClientPC pass CAO reference as a parameter to SAO so that SAO can use the same CAO the client holds a reference to.
>
> Thanks,
>
> Sam

Yes, you can. I have done in the past the following:

1. ServerA (SAO)
2. ServerB (SAO)
3. Client

Client gets a CAO from ServerA SAO, and the passes it to ServerB.
ServerB was able to work with the same CAO. It should work with only one
server as well.

Sunny