Its looks like O_NONBLOCK is not set but its definitely acting like it is.  
However, setting up select() on read() solved the issue.  I didn’t think it 
would be necessary on a blocking read but there is something going on behind 
the scenes in 10.12 that makes it necessary.

Thanks,
Jeremy

> On Oct 27, 2016, at 4:00 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> 
> wrote:
> 
> Out of curiosity, and to get more information, you could try:
> 
> a) use FD_ISSET(2) to see if O_NONBLOCK is really set on the socket. If so, 
> use FD_ZERO(2)/FD_SET(2) to clear O_NONBLOCK on the socket prior to read(2).
> c) use a select(2) call in front of the read(2)
> 
> I would suspect O_NONBLOCK really isn't set, and there is more going on here 
> than meets the eye...
> 
> HTH,
> -Carl
> 
> 
>> On Oct 27, 2016, at 3:15 PM, Jeremy Thompson <jer...@warehousesports.com> 
>> wrote:
>> 
>> I have a strange problem that has showed up in OS X 10.11 and 10.12.  My 
>> application is still using carbon libraries but all network communication is 
>> done through BSD sockets.  When running the application on 10.11 in debug 
>> mode certain times the read() call will return with this error Resource 
>> temporarily unavailable.  I could see this happening if the socket was in 
>> non-blocking mode but it is supposed to block.  The resource temporarily 
>> unavailable error comes from perror.  I tried getting the error from the 
>> socket with getsockopt and it returns an undefined error: 0.  To make this a 
>> little bit more strange if I run this application in release mode none of 
>> this comes up.  However, now in 10.12 i get this error in both debug and 
>> release mode.  I first thought this may be a problem on the server side but 
>> it sends back correct data on a wireshark capture.  I’m pretty sure its 
>> locked down to the client application.  If I didn’t know better I would say 
>> that the socket is somehow getting set to non-blocking but I can’t prove it. 
>>  This problem is nonexistent on 10.9 but I am unsure about 10.10 as I never 
>> debugged the code on that version.  Any info would be greatly appreciated.
>> 
>> Thanks,
>> Jeremy
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/macnetworkprog/newslists%40autonomy.caltech.edu
>> 
>> This email sent to newsli...@autonomy.caltech.edu
> 

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to