Paste: Client Server doesn't work

Author: besimo
Mode: factor
Date: Fri, 22 May 2009 11:56:53
Plain Text |
CLIENT:

USING: calendar.format io io.sockets io.encodings.ascii ;
IN: simple-client

: c2s ( hostname -- )
    1234 <inet> ascii [ readln ] with-client ;

MAIN: c2s


SERVER:
USING: io io.servers.connection accessors threads prettyprint io.sockets ;
IN: simple-server

: handle-client ( -- )
    "connected" ;

: <simple-server> ( -- threaded-server )
    <threaded-server>
        "ping-server" >>name
        1234 >>insecure
        [ handle-client ] >>handler ;

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

MAIN: start-simple-server

New Annotation

Summary:
Author:
Mode:
Body: