Ken Kolda
11/3/2004 4:15:00 PM
For the issue of the Cancel object, you would need to have your server
object spawn a new thread to perform the actual processing. The function
would then return the Cancel object to the client.
As for Singleton vs. SingleCall, this really depends on your needs.
Actually, based on what you've said, a CAO may be more appropriate than
either of these SAO types. Each client would create its own object instance
on the server and invoke it to start the process. Using this technique you
could even avoid having a Cancel object altogether -- there would simply be
a Cancel() method on the CAO type which would flag the thread which is doing
the processing.
Ken
"sbparsons" <sbparsons@discussions.microsoft.com> wrote in message
news:2ED9B13F-650E-484C-A47B-B34222E928CF@microsoft.com...
> I like your CAO idea, Ken, but am having a few problems.
> I have defined a common 'Cancel' object alongside my server interface so
> that both client and server have access to the type. On the server I have
> instantiated a new 'Cancel' object. I have passed in a delegate to a
server
> procedure that sets a cancel flag - this delegate will be invoked by the
> client during the cancel event.
>
> With a singlecall object, though, how can I pass this object back to the
> client? The client obviously only makes one call to the server object
which
> is the call to the lengthy procedure - so no return value until the end of
> this procedure.
>
> At the end of the day, I can use a singleton to preserve state but may
> discover a few threadsafe worries - they might be easier to overcome
though...
> My original query (see start of this 'thread') was actually trying to
gauge
> the benefits of SingleCall over Singleton so any input there would be
great.
>
> Thanks for your help.
> Sean
>