• 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: Exiting NSThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exiting NSThread


  • Subject: Re: Exiting NSThread
  • From: Dustin Mierau <email@hidden>
  • Date: Sat, 29 Sep 2001 14:52:05 -0700

What I meant was I have a thread which connects using bsd sockets to say an ftp server, now i am in the middle of downloading a file in a while loop, now the app quits, how do i exit that thread cleanly? I want to obviously close the connection to the server and exit the thread.

Thanks,
-dustin

Dustin,

Dustin Mierau (DM) wrote at Sat, 29 Sep 2001 13:27:16 -0700:
DM> connect_to_host(IP,port);
DM>
DM> while(1)
DM> {
DM> read_data_for_a_long_long_long_time();
DM> }
DM>
DM> disconnect();
DM>
DM> If the thread is just cleaned up for me, how do I ever disconnect?

Connections are cleaned as well.

If you happen to use some resource which is *not* cleaned up (like, say, an
external file), you should clean it up in appWillTerminate: (or some
appropriate notification observer).
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Follow-Ups:
    • Re: Exiting NSThread
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Exiting NSThread (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Exiting NSThread
  • Next by Date: Finder and Apple Events
  • Previous by thread: Re: Exiting NSThread
  • Next by thread: Re: Exiting NSThread
  • Index(es):
    • Date
    • Thread