I start a new thread using NSThread's class method
detachNewThreadSelector:toTarget:withObject:
The new thread calls a library function that reads data from a
socket
(the library is the Stomp protocol C client library). This
function is
blocking.
I need to stop this new thread immediately when the users asks it
by,
for example, clicking a button, so I need to stop that thread from
the
main thread. Which is the simplest way to do that?
In this case likely close the socket it is listening on.
We recently had a long thread on this list about trying to stop
threads that are blocked on network traffic (e.g. NSURL).
You might want to look in the archives over the past week.
The short answer: you can't kill threads directly, but you can design
your code so that there is no need to do so._______________________________________________
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