Re: Mac TCP Programming

2005-12-18 Thread Peter da Silva
Yes, that is what is does, I have however since the last post traced 
the
problem to a degree anyway, I put it down to [1] the problem was when 
I was
running through the debugger, and [2] I have no mac UI of any sort as 
I am
using Think C's console (so I can printf and see what is going on), 
this I
believe was not supplying any events so the WaitNextEvent was just 
sitting

there.


Pretty much the whole of Mac OS lives in the UI. You can't get mouse 
and keyboard (or even, I suspect, disk I/O) without WaitNextEvent()ing 
somewhere.


But maybe I misunderstand what Think C's console is. Is it some kind of 
serial-port console or something?



--
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
---


Re: Mac TCP Programming

2005-12-18 Thread Peter da Silva
Yes, that is what is does, I have however since the last post traced 
the
problem to a degree anyway, I put it down to [1] the problem was when 
I was
running through the debugger, and [2] I have no mac UI of any sort as 
I am
using Think C's console (so I can printf and see what is going on), 
this I
believe was not supplying any events so the WaitNextEvent was just 
sitting

there.


OK, I just caught this.

As I understand it, the low-level TCP code is supposed to be generating 
events that will satisfy WaitNextEvent(). It's possible that the TCP 
stack is poorly integrated with Mac OS and is using some other 
signalling mechanism. If that's the case, your socket code probably 
needs to pick up the slack and provide the necessary glue to feed 
packets into the event stream by making the sockets into file handles.



--
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
---


Re: Mac TCP Programming

2005-12-18 Thread Sean Billings

Pretty much the whole of Mac OS lives in the UI. You can't get mouse 
and keyboard (or even, I suspect, disk I/O) without WaitNextEvent()ing 
somewhere.

But maybe I misunderstand what Think C's console is. Is it some kind of 
serial-port console or something?

The Think C Console gives a STDIO window that makes porting console command
line apps possible on the Mac, it means I can get to grips with the network
side of System 7 programming without having to learn the UI side for the
moment.  Luckily the first apps I have in mind don't require a UI they just
need to startup do their business and shut down quietly.

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
---


Re: Mac TCP Programming

2005-12-18 Thread Sean Billings
 believe was not supplying any events so the WaitNextEvent was just 
 sitting
 there.

OK, I just caught this.

As I understand it, the low-level TCP code is supposed to be generating 
events that will satisfy WaitNextEvent(). It's possible that the TCP 
stack is poorly integrated with Mac OS and is using some other 
signalling mechanism. If that's the case, your socket code probably 
needs to pick up the slack and provide the necessary glue to feed 
packets into the event stream by making the sockets into file handles.


Well the TCP stack I prefer is MacTCP as OpenTransport is too big for
compacts IMO.  As I now know the debugger is getting in the way of the
Event Mechanism I should hopefully be able to look out for future problems,
I'll keep the list posted on my progress.

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
---


Re: Mac TCP Programming

2005-12-17 Thread Peter da Silva
WaitNextEvent() should throw you into the system event loop, you 
shouldn't have to call SystemTask() or anything else.


I'm sure you know this, but just in case... classic Mac OS applications 
ran in an environment quite unlike any modern multitasking environment. 
They were more like UNIX kernel processes, and had to explicitly yield 
the CPU before any action could be taken on their behalf by the OS. 
Even in the last versions of Mac OS, multitasking was never an 
invisible undercurrent of activity that only troubles a process when it 
cares about real-time events or when it has to coordinate itself with 
another process.


But WaitNextEvent (the CPU-friendly version of the original 
GetNextEvent) should do everything you need... so long as you get to it 
in time.


I don't know what Spin() looks like, but if it's the event handler for 
your networking code it has to call WaitNextEvent or at least 
GetNextEvent at least once in every pass through it, and at least once 
in a while in every long-running loop.



--
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
---


Re: Mac TCP Programming

2005-12-17 Thread Sean Billings
WaitNextEvent() should throw you into the system event loop, you 
shouldn't have to call SystemTask() or anything else.

I was using SystemTask as more of a waste some time here before getting to
the WaitNextEvent really, I was just hoping it would be process friendly.


I'm sure you know this, but just in case... classic Mac OS applications 
ran in an environment quite unlike any modern multitasking environment. 
They were more like UNIX kernel processes, and had to explicitly yield 
the CPU before any action could be taken on their behalf by the OS. 
Even in the last versions of Mac OS, multitasking was never an 
invisible undercurrent of activity that only troubles a process when it 
cares about real-time events or when it has to coordinate itself with 
another process.

I've programmed various machines and OS with differing process capabilities
but I will bear that in mind and it does explain why the system clock can
be frozen quite easily!



But WaitNextEvent (the CPU-friendly version of the original 
GetNextEvent) should do everything you need... so long as you get to it 
in time.

I don't know what Spin() looks like, but if it's the event handler for 
your networking code it has to call WaitNextEvent or at least 
GetNextEvent at least once in every pass through it, and at least once 
in a while in every long-running loop.

Yes, that is what is does, I have however since the last post traced the
problem to a degree anyway, I put it down to [1] the problem was when I was
running through the debugger, and [2] I have no mac UI of any sort as I am
using Think C's console (so I can printf and see what is going on), this I
believe was not supplying any events so the WaitNextEvent was just sitting
there.

Anyway when my code is run direct it does appear to work, at least to the
degree I have it now, I still need to figure out sending and receiving data
and trying to work out why I can't get the resolver to work :-(

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
---