Re: OpenTransport behaviour under X
Re: OpenTransport behaviour under X
- Subject: Re: OpenTransport behaviour under X
- From: Lyndsey Ferguson <email@hidden>
- Date: Mon, 27 Oct 2003 11:14:22 -0500
I want to understand: I understand that with asynchronous, you have to
install notifier functions that get called at deferred task time. With
synchronous, you basically want to handle events as they happen.
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...
Oh and by the way, our program does broadcast to 255.255.255.255
successfully under OS X - but I may have to change that as I think Internet
Security programs are mucking things up :)
On 10/27/03 11:00 AM, "Marc Stibane" <email@hidden> wrote:
>
> I thought that OTLook was to poll for data event or to find out what failed
>
> in the case of an kOTLookErr and clear the endpoint for more usage.
>
That's the case if the code is running asynchronous. But my code is
>
running synchronous.
>
>
> So, as I understand it, you don't have to call OTLook; you can continue to
>
> call OTRcv until you have no more data. Correct?
>
Yes, but then you get blocked if there is no data.
>
That's what OTLook is used for, find out whether there's data available.
>
If not, the code wouldn't call OTRcv (which would block).
>
>
> You can check the T_MORE flag parameter to see if there is more data ready
>
> to be collected.
>
True. But not even neccessary in my case, since OTCountDataBytes said 8
>
bytes and the code just wants to read 4 bytes, one after the other.
>
>
Of course I could just fix it and read the whole 4 bytes in one
>
operation, but said routine is called "sync" and I am pretty sure the
>
linux server at the other end is also sending that data byte by byte.
>
Some kind of protocol... The code consists of a state machine which
>
increments its state whenever one byte is read. I really would like to
>
not change that (because the same source code is used for Windows and
>
MacOS 9) and instead find out why OTLook doesn't return T_Data.
>
>
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?
>
>
>
--
Lyndsey D. Ferguson
Software Engineer
Nemetschek N.A., Inc.
email@hidden
--
_______________________________________________
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.