• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Stopping a DO work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stopping a DO work


  • Subject: Re: Stopping a DO work
  • From: Robert S Goldsmith <email@hidden>
  • Date: Mon, 24 Sep 2001 12:04:38 +0100

Hi :)

Well, I assume that it is not the actual message being sent across the network but the calculation required to return the result that is taking the time. I have two suggestions.

First, you could stop using synchronous communication and use a series of callbacks instead. eg. you send a request and then get on with other things. When finished, the server sends a message with the result. This does not mean the DO communication need be asynchronous, just that the request you send does not return anything (the method you call is void). Instead, the method has a 'side effect' of sending your client a 'I'm done, here's the result' message.

The secod option is to have a second channel, a control channel. Send your normal message and if you want to stop the process, send an asynchronous message on the control channel. This will cause an interupt at the other end and the main process will simply stop and return 0 or something.

I prefer the first option because programming the interupt (and I don't mean it has to be a system interupt, just something that can interupt the calculations) is a pain. If you use the first method and the user cancels, simply disgard the result when it finally returns.

Robert

kubernan wrote:

Hello,

I have a client/server application based on DO.
After sending a request to the server, the response
can take very long time. It depends on some paramaters
on my client GUI.
What i want to do is to offer to the user the possibility
to stop the server work (not the server itself).
The setReplyTimeout (NSConnection) doesn't stop the
server process but only that wait of the client.

What is the mean to stop a DO server process ?

Thx.
Kub.
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Stopping a DO work (From: kubernan <email@hidden>)

  • Prev by Date: RE: static typing (Learning Cocoa Chapter 13)
  • Next by Date: Re: Is there a decent Obj-C for Windows?
  • Previous by thread: Re: Stopping a DO work
  • Next by thread: Re: Stopping a DO work
  • Index(es):
    • Date
    • Thread