Hey Folks,
Why doesn't work time-outs for read() on sockets ?
In my code it blocks until some data arrives or the connection breaks.
It doesn't matter which timeout-value I set, tried things like: 0 ticks,
1 tick, 10 ticks, 1 second, 20 seconds, ... . All of em block forever.
what am I doing wrong, where's the trick?
here are some code fragments:
--------------------8<-----------------
Setup:
err = SysLibFind("Net.lib", &AppNetRefnum); ...
err = NetLibOpen(AppNetRefnum, &ifErrs); ...
AppNetTimeout = SysTicksPerSecond() * 10;
Open connection:
SocketRef = NetUTCPOpen( par_ip, NULL, par_port);
Read ( first line in the event loop):
l = read( SocketRef, ReadBuffer, READ_BUFFER_SIZE);
//l = NetLibReceive( AppNetRefnum, SocketRef, ReadBuffer,
READ_BUFFER_SIZE, 0, 0, 0, 0, &errno); // doesn't work either!
--------------------8<-------------------
I'm using Copilot 2.1d29 - is this the problem?
1.0beta9 which comes with the GNU SDK doesn't seems seem to support
networking - is this right?
I'd need to react to user inputs while waiting for data to arrive,
that's why the time-out is that important.
Any suggestions?
Markus