• 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: Context in GCD source cancel handler?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Context in GCD source cancel handler?


  • Subject: Re: Context in GCD source cancel handler?
  • From: Jonathon Kuo <email@hidden>
  • Date: Thu, 6 Jan 2011 13:40:33 -0800

Wonderful, will do!
Thanks to all!

On Jan 6, 2011, at 1:31 PM, Dave Zarzycki wrote:

> Jonathon,
>
> Please don't use SIGPIPE. That's just a hack from the 1970s to make simple command line programs die when their input goes away. Instead, please call signal(SIGPIPE, SIG_IGN) right inside of main(). Thereafter, Unix APIs like read(), write(), etc will return -1 and errno will be equal to EPIPE.
>
> davez
>
> On Jan 6, 2011, at 1:22 PM, Jonathon Kuo wrote:
>
>> On Jan 6, 2011, at 1:15 PM, Fritz Anderson wrote:
>>
>>> Taking "by value" to mean "as many uninterpreted bits as will fit into a variable of type void*," yes.
>>
>> On Jan 6, 2011, at 1:14 PM, Dave Zarzycki wrote:
>>
>>> Yes, that is the nature of void *. Nothing can be known about a void * other than the value – therefore you can store anything there (even non-pointers as long as they are <= sizeof(void *)).
>>
>> Awesome! I get it now. This all came about because I am getting an occasional SIGPIPE when one of my read sources is closed on the client end, so having a context is great. Thanks!!
>>
>> BTW, is there an inherent signal-handling capability with GCD so my program doesn't get blown out of the water when a SIGPIPE happens?
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please 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
>
>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: 
 >Context in GCD source cancel handler? (From: Jonathon Kuo <email@hidden>)
 >Re: Context in GCD source cancel handler? (From: Dave Zarzycki <email@hidden>)
 >Re: Context in GCD source cancel handler? (From: Jonathon Kuo <email@hidden>)
 >Re: Context in GCD source cancel handler? (From: Dave Keck <email@hidden>)
 >Re: Context in GCD source cancel handler? (From: Jonathon Kuo <email@hidden>)
 >Re: Context in GCD source cancel handler? (From: Fritz Anderson <email@hidden>)
 >Re: Context in GCD source cancel handler? (From: Jonathon Kuo <email@hidden>)
 >Re: Context in GCD source cancel handler? (From: Dave Zarzycki <email@hidden>)

  • Prev by Date: Re: NSDictionary key types
  • Next by Date: Re: LOCATING MEDIA FILES IN MACINTOSH
  • Previous by thread: Re: Context in GCD source cancel handler?
  • Next by thread: execute system("some script") on behalf of root from non-root app
  • Index(es):
    • Date
    • Thread