Paste: echo server test

Author: ycros
Mode: factor
Date: Sun, 9 Aug 2009 20:24:12
Plain Text |
USING: io io.servers.connection io.encodings.ascii threads accessors ;
IN: echo-server

: handle-echo-client ( -- )
    [ print yield ] each-line ;

: <echo-server> ( -- threaded-server )
    ascii <threaded-server>
        "echo-server" >>name
        3333 >>insecure
        [ handle-echo-client ] >>handler ;

: start-echo-server ( -- threaded-server )
    <echo-server> [ start-server ] in-thread ;

New Annotation

Summary:
Author:
Mode:
Body: