Hello,

I hope it is ok to ask development questions on this list, it should be on
topic as I am developing apps for compacts ;-)

Now, I don't know much about system 7 programming, so I hope someone here
knows more...

I am using Think C and I am attempting to develop a library similar to
simple sockets that will allow me to easily port some of my unix tcp apps
to the compact, the first one is just a trial app to retreive the daytime
message on port 13 from a unix machine on my network, I am having a lot of
problems but the current issue is with the spin routine which calls
WaitNextEvent, this routine is called while waiting for MacTCP to do its
thing.  The problem I'm having is the Spin routine sometimes just loops
round and I think it may have something to do with being called too quickly
in succession.

The reason I think this is if add the following code I can sort of get a
reliable connection:

static long lastTickCount;

if(lastTickCount==0)
        lastTickCount=TickCount();
while(TickCount() < lastTickCount+5)
        SystemTask();
lastTickCount=TickCount();

Now I googled around to find SystemTask() which I was hoping would be like
Windows DoEvents() or Unix Sleep statements, but I'm not sure.

Has anyone got any suggestions or even better some example Think C 5 code
that connects to a tcp port, I've got an example TCP server but not a TCP
client.

Regards Sean.
--
Classic Computing Pages:
http://www.megadon.co.uk/syrinx/



-- 
Compact Macs is sponsored by <http://lowendmac.com/>.

      Support Low End Mac <http://lowendmac.com/lists/support.html>

Compact Macs list info: <http://lowendmac.com/lists/compact.shtml>
  --> AOL users, remove "mailto:";
Send list messages to:  <mailto:compact.macs@mail.maclaunch.com>
To unsubscribe, email:  <mailto:[EMAIL PROTECTED]>
For digest mode, email: <mailto:[EMAIL PROTECTED]>
Subscription questions: <mailto:[EMAIL PROTECTED]>
Archive:<http://www.mail-archive.com/compact.macs%40mail.maclaunch.com/>


---------------------------------------------------------------
iPod Accessories for Less
at 1-800-iPOD.COM
Fast Delivery, Low Price, Good Deal
www.1800ipod.com
---------------------------------------------------------------

Reply via email to