• 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: Guidance needed: IrDa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guidance needed: IrDa


  • Subject: Re: Guidance needed: IrDa
  • From: John Anderson <email@hidden>
  • Date: Fri, 18 Oct 2002 14:38:41 -0700

Are you removing youself as an observer as well?

John

On Friday, October 18, 2002, at 02:01 PM, Andreas Mayer wrote:

Am Freitag, 18.10.02 um 19:26 Uhr schrieb John Anderson:

Are you releasing the NSFileHandle that you're readingInBackgroundAndNotifying?

Yes. But the file handle is retained by the read thread:

NSLog([NSString stringWithFormat:@"openPortWithOptions(1): portHandle retain count: %d", [portHandle retainCount]]);
[portHandle readInBackgroundAndNotify];
NSLog([NSString stringWithFormat:@"openPortWithOptions(2): portHandle retain count: %d", [portHandle retainCount]]);

prints:

2002-10-18 22:30:25.545 goSerial[1375] openPortWithOptions(1): portHandle retain count: 1
2002-10-18 22:30:25.546 goSerial[1375] openPortWithOptions(2): portHandle retain count: 2

The problem is, that the read() call that's supposedly used by the background thread will not fail/return if I issue a close().

I got an idea though. Maybe it'll help if I set the O_NONBLOCK flag before closing the device ... no. Does not help either. :(

Of course I could just poll for data instead. <sigh>


What's strange is: Even though the device seems still active (DTR high) it is not listed by lsof any more.
And if I open a new device, I get the same file descriptor that I had right before.


bye. Andreas.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Guidance needed: IrDa
      • From: Andreas Mayer <email@hidden>
References: 
 >Re: Guidance needed: IrDa (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: How to avoid a Windows interface on OS X?
  • Next by Date: Re: NSLayoutManager vs BBEdit (Was Re: Carbon vs Cocoa arguments)
  • Previous by thread: Re: Guidance needed: IrDa
  • Next by thread: Re: Guidance needed: IrDa
  • Index(es):
    • Date
    • Thread