• 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: Socket Blocking Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Socket Blocking Question


  • Subject: Re: Socket Blocking Question
  • From: Greg Guerin <email@hidden>
  • Date: Wed, 20 Jan 2010 14:41:37 -0700

Carter R. Harrison wrote:

> The second way is to send a request and then let the NSInputStream call a
> delegate method when the response data is available. The response data is
> then pushed up through my protocol stack and finally up to the higher level
> application code. The benefit to this method is that CPU usage is minimal
> due to the fact that I'm no longer blocking, but the downside is that the
> higher level application code is so much more difficult to write because I
> have to write about a thousand methods to act as a callback for each request
> in a series of requests.


Maybe structure it as a Finite State Machine:

http://en.wikipedia.org/wiki/Finite-state_machine
http://en.wikipedia.org/wiki/Event_driven_finite_state_machine

I have done FSM's using AsyncSocket (and AsyncUdpSocket) and they worked great.

  -- GG

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Socket Blocking Question
  • Next by Date: Re: Problem using bindings with deep key paths
  • Previous by thread: Re: Socket Blocking Question
  • Next by thread: Presets & NSPrintPanel accessory view
  • Index(es):
    • Date
    • Thread