On Mon, May 10, 2010 at 11:50:52PM +0200, Henrik Sarvell wrote:
> My code simply stops executing (as if waiting for the next entry but
> it never gets it) when I run out of entries to fetch, really strange
> and a traceAll confirms this, the last output is a call to rd1>.

What happens on the remote side, after all entries are sent? If the
remote doesn't 'close' (or 'bye'), then the receiving end doesn't know
it is done.


> This is my rd1>:
> 
> (dm rd1> (Sock)
>    (or
>       (in Sock (rd))
>       (nil
>          (close Sock))))

This looks all right, but isn't obviously the problem, as it hangs in
'rd'.


> (de getArticles (W)
>    (for Wc (sortBy> '+Gh (collect 'word '+WordCount W) 'picoStamp)
>      (pr (cons (; Wc article) (; Wc picoStamp)))
>      (unless (flush) (bye))))

What happens if you do (bye) after the 'for' loop is done?

I assume that 'getArticles' is executed in the (eval @) below


>    (task (port (+ *IdxNum 4040))
>       (let? Sock (accept @)
>          (unless (fork)
>             (in Sock
>                (while (rd)
>                   (sync)
>                   (out Sock
>                      (eval @))))
>             (bye))
>          (close Sock)))

This looks OK, because (bye) is called after the while loop is done.
Perhaps there is something in the way 'getArticles' is invoked here? You
could change the second last line to (! bye) and see if it is indeed
reached. I would suspect it isn't.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to