Re: Guidance needed: IrDa
Re: Guidance needed: IrDa
- Subject: Re: Guidance needed: IrDa
- From: Andreas Mayer <email@hidden>
- Date: Fri, 18 Oct 2002 23:01:13 +0200
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.