'timer issue?
Posted: Mon Jul 31, 2006 11:26 am
Hi Lutz,
There is someting odd with the behaviour of 'timer.
(I thought it was my OS/2 port...but its not..)
The 'timer example (sockets and timer) from the 8.9.1 manual does not work
on linux or OS/2 or WinXP..
(It simple does not return the 'timeout' text keeps in a loop...)
The strange thing is though... when I execute FIRST the timer routine and Then
the socket-init it all works on OS/2, but this does not work on Linux nor on WinXP..
What could be the problem with timer..?
This does not work on any system ->
(define (interrupt)
(set 'timeout true))
(set 'listen (net-listen 30001))
(set 'socket (net-accept listen))
(timer 'interrupt 10)
; or specifying the function directly
(timer (fn () (set 'timeout true)) 10)
(until (or timeout done)
(if (net-select socket "read" 100000)
(begin
(read-buffer socket 'buffer 1024)
(set 'done true)))
)
(if timeout
(println "timeout")
(println buffer))
(exit)
But this works on OS/2 (not on Linux or WinXP) ->
(define (interrupt) (set 'timeout true))
(timer 'interrupt 10.0)
(set 'listen (net-listen 30001))
(set 'socket (net-accept listen))
(until (or timeout done)
(if (net-select socket "read" 100000)
(begin
(read-buffer socket 'buffer 1024)
(set 'done true)))
)
(if timeout (println "timeout") (println buffer))
(exit)
Regards, Norman
There is someting odd with the behaviour of 'timer.
(I thought it was my OS/2 port...but its not..)
The 'timer example (sockets and timer) from the 8.9.1 manual does not work
on linux or OS/2 or WinXP..
(It simple does not return the 'timeout' text keeps in a loop...)
The strange thing is though... when I execute FIRST the timer routine and Then
the socket-init it all works on OS/2, but this does not work on Linux nor on WinXP..
What could be the problem with timer..?
This does not work on any system ->
(define (interrupt)
(set 'timeout true))
(set 'listen (net-listen 30001))
(set 'socket (net-accept listen))
(timer 'interrupt 10)
; or specifying the function directly
(timer (fn () (set 'timeout true)) 10)
(until (or timeout done)
(if (net-select socket "read" 100000)
(begin
(read-buffer socket 'buffer 1024)
(set 'done true)))
)
(if timeout
(println "timeout")
(println buffer))
(exit)
But this works on OS/2 (not on Linux or WinXP) ->
(define (interrupt) (set 'timeout true))
(timer 'interrupt 10.0)
(set 'listen (net-listen 30001))
(set 'socket (net-accept listen))
(until (or timeout done)
(if (net-select socket "read" 100000)
(begin
(read-buffer socket 'buffer 1024)
(set 'done true)))
)
(if timeout (println "timeout") (println buffer))
(exit)
Regards, Norman