Re: Re: Cocoa HTTP Server & threadin
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