Re: Repost: OpenTransport problems under X [solved]
Re: Repost: OpenTransport problems under X [solved]
- Subject: Re: Repost: OpenTransport problems under X [solved]
- From: Marc Stibane <email@hidden>
- Date: Wed, 26 Nov 2003 17:12:47 +0100
Quinn wrote:
>
First up, I strongly recommend that you switch your code to using
>
sockets. You already have working OT code for 9 and working sockets
>
code for Windows. Rather than struggling to get working OT code for
>
X (the end result of which is highly undesirable, involving multiple
>
levels of emulation, that is, app -> sockets abstraction layer ->
>
socket emulation on OT -> OT emulation on sockets -> sockets), it'll
>
be better for all concerned if you go directly to sockets.
Done that. Now it works. I had to solve a few quirks because the socket
code was based on WinSOCKS which is not really the same as BSD sockets.
However I had some problems with "select":
My code tries to read a small TIFF image from our RIP. It reads one
scanline at a time (e.g. 290 bytes) while the RIP stuffs as many bytes as
possible into each packet (e.g. 1440 bytes).
For each scanline my code first finds out whether there is data by
calling "select" with a timeout of 1 second. If "select" returns 1, I
then read the scanline.
The problem is, that "select" always returns 1 as expected (since the RIP
keeps sending), but only the first call returns immediately. The next
calls take a very long time to return. It looks like the full timeout
time is used until "select" returns, so the whole image (500 scanlines)
takes a few minutes to transfer instead of one second (which it does on
MacOS 9 and on Windows).
Question: Is this the intended behaviour of select?
I made a workaround by just trying to read from the socket, and only if
that fails calling "select". Works, I now get the TIFF fast enough
(didn't bother to measure whether it's slower or faster than Windows).
Marc Stibane
Fesh! email@hidden
Kurf|rstenstr. 154 tel +49-30-3990 2690
10785 Berlin, Germany mobil +49-173-6522 422
In a world without walls and fences,
who needs windows and gates?
_______________________________________________
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.