Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFRunLoopRun() hangs up after ReadPipeAsync() called in Mac OS X



Hello all,

We are trying to communicate with a printer through USB on MAC OS X.
Basically we did followings:

1. OpenUSBPort(). Here we make: IOUSBInterfaceInterce, inPipe, and outPipe,
etc ready.  CreateInterfaceAsyncEventSource(), and CFRunLoopAddSource() are
called here.

2. WriteToPort(). Here we called WritePipeAsync(intfIntf, outPipe, outBuf,
nSize, WriteCompletion, dummy), then call CFRunLoopRun(). WriteCompletion
function is called as expected. Inside WriteCompletion function, we called
CFRunLoopStop(CFRunLoopGetCurrent(). Everything goes fine.

3. ReadFromPort(). We called ReadPipeAsync(intfIntf, inPipe, inBuf, nSize,
ReadCompletion, dummy). The programming returns with noErr here. Then we
called CFRunLoopRun( ), which leads the application hangs there forever.
This results that the ReadCompletion function never got called. Inside
ReadCompletion function, we called CFRunLoopStop(CFRunLoopGetCurrent(). If
we remove the CFRunLoopRun() inside ReadFromPort(), sometimes we can get
data back, but not everytime. There is no such problem for this printer on
other OS.

4. CloseUSBPort() just does the cleanup.

Could someone help me out from the hanging up problem?

Thanks in advance.

Kane Zheng

Scanvec Amiable.
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.