How do I? Know when a _tcp_ port is empty?

Here's a section of my code loosely copied and combined from the Rebol
WebServer and Langreiter's vanillean http://www.langreiter.com

    Listen: port!
    Connection: port!
    Stop: false
    set 'Web-Server function [
        Port [integer!] Web [file!]
        ][
        Request Filename Data
        ][
        Listen: open/lines join tcp://: Port
        while [not Stop] [
            Connection: first wait Listen
            Request: make string! 1024
            repend Request [first Connection newline]
            while [not 1 = length? Connection/state/inBuffer] [
; the above line disturbs me seriously...
                repend Request [first Connection newline]
                ]
            print Request

Using lines such as:
        empty? Connection
    seems to lead to infinite loops.

Can some one point me in the right direction please?

Thanks!

PS In case you're interested, this project (Spider) is a Wiki and Sparrow in
one, along with remote updating of web pages on sites without CGI access.
The ultimate Web Dialect!

Andrew Martin
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
-><-


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to