Re: OpenTransport behaviour under X
Re: OpenTransport behaviour under X
- Subject: Re: OpenTransport behaviour under X
- From: Aaron Ballman <email@hidden>
- Date: Mon, 27 Oct 2003 10:38:12 -0600
So how are you handling that? Are you polling OTLook in a thread? The first
time you receive a message that you have T_Data on the line, you can grab
the bits of it with OTRcv until it reports that there is no more data. As
I've said, I'm new at this - but maybe our discussion will prompt a reply
from the seasoned veterens...
You don't need to poll for data in a thread (tho that is certainly
one way you can do it). I use OTLook when I want to read something
synchronously. The call will tell me whether there is data
available to be read. If there isn't data available to be read, then
the call to OTRcv will block until there _is_ data, which can be
annoying. So basically, I'll do something like this:
OTSnd my data out
while (true) {
if OTLook says there's data then
OTRcv the data
Check to see if I have all the data I expect back
If I have it all, break the while loop
end if
DoSomeUIUpdatingCode
}
This way I can have a responsive UI and still use a sync. socket.
HTH!
~Aaron
--
Handy UNIX Commands:
sudo grep -e "My mind" -H -r /
mv /mnt/fuji /mnt/everest
mv "Ignorance" /dev/null
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.