Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Cocoa HTTP Server & threadin



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.