Phil Greg
11/5/2004 1:48:00 PM
This sounds good, but since a CAO is a client activated object, how can it be
returned by a Server activated one?
"Ken Kolda" wrote:
> Here's how I do it: instead of returning a number to the client, return an
> instance of a CAO (e.g. a Session object). This CAO will hold some sort of
> identifying information for the client such as the index you referred to.
> Then move all of your server's methods that require knowledge of the
> client's identity to be methods on the CAO. When your client invokes a
> method, the object through which it is invoked provides the context/identity
> for the call.
>
> Ken
>
>
> "Phil Greg" <PhilGreg@discussions.microsoft.com> wrote in message
> news:495A3FE1-31F5-4BE8-976D-A47ED03EA694@microsoft.com...
> > Alright, I've been at this for a couple of days now, and thanks to the
> > helpful people on this forum, I've finally got a C++ project working
> pretty
> > well.
> >
> > There's still something I wonder, though. Here's how my stuff works:
> >
> > When a client is started, it calls up a method called RegisterWithServer
> on
> > the server, which returns the 0 based index of the newly register
> instance.
> > When that instance wants to call up a certain function, it needs to
> provide
> > its instance number so it can ben identified. What I want to know is: is
> > there any way the server can know who's calling its functions (maybe by
> > checking which port the message is coming from), without the client having
> to
> > provide its instance number?
>
>
>