Re: No data from endpoint until it's closed?
Re: No data from endpoint until it's closed?
- Subject: Re: No data from endpoint until it's closed?
- From: Quinn <email@hidden>
- Date: Thu, 8 Aug 2002 00:33:31 +0100
At 14:09 -0600 7/8/02, David Catmull wrote:
I'm using synchronous blocking OT endpoints with threads. In OS X, it all
works fine. In OS 9.2.2, OTRcv doesn't return until the other side sends a
disconnect. Then I finally get the data that was sent, followed by the
disconnect. What could be causing this?
What size buffer are you passing in to OTRcv? In sync/blocking mode,
OTRcv is defined to not return until that buffer is full, or some
other event occurs on the endpoint. Mac OS X has a bug that causes
OTRcv to return as soon as any data arrives, which is how things work
under sockets. If the buffer you're passing in is much bigger than
the data you're expecting, your code will work on X (because of this
bug) but not on 9.
The normal way to get the sockets-like behaviour is to do a
sync/blocking OTRcv for 1 byte, and then do a non-blocking receive
for the rest.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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.