• 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: Re: Cocoa HTTP Server & threadin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Cocoa HTTP Server & threadin


  • Subject: Re: Re: Cocoa HTTP Server & threadin
  • From: "Philip Q" <email@hidden>
  • Date: Wed, 20 Dec 2006 19:41:08 +1300

On 20/12/06, Brad Peterson <email@hidden> wrote:
I agree that this is the right place, but I'm stumped.
I don't mean to be dense but I don't see any way to
convert this into something I can pass into NSThread's
detachNewThreadSelector.

That's because there isn't. When a new connection comes in, you'll need to fire off a new thread to handle it.

Briefly looking at the code, this new thread will need to do what
-handleNewConnectionFromAddress:inputStream:outputStream: is doing
now.
If you want a responsive interface for the application, the part that
handled new connections will need to be in a thread of it's own.

Also, I don't think that responding in a separate
thread is what I need, since I really want it to
listen for connections in a separate thread; to make
the entire TCPServer class run in its own thread.

You'll need to do both.

-Phil
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Re: Cocoa HTTP Server & threading (From: Andrew Farmer <email@hidden>)
 >Re: Cocoa HTTP Server & threading (From: Brad Peterson <email@hidden>)

  • Prev by Date: Re: passing data to threads
  • Next by Date: Re: Delegates -- WHAT is delegated?
  • Previous by thread: Re: Cocoa HTTP Server & threading
  • Next by thread: Re: Cocoa HTTP Server & threading
  • Index(es):
    • Date
    • Thread