Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Echo-server/Factor/echo-server.factor
Normal file
16
Task/Echo-server/Factor/echo-server.factor
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
USING: accessors io io.encodings.utf8 io.servers io.sockets threads ;
|
||||
IN: rosetta.echo
|
||||
|
||||
CONSTANT: echo-port 12321
|
||||
|
||||
: handle-client ( -- )
|
||||
[ print flush ] each-line ;
|
||||
|
||||
: <echo-server> ( -- threaded-server )
|
||||
utf8 <threaded-server>
|
||||
"echo server" >>name
|
||||
echo-port >>insecure
|
||||
[ handle-client ] >>handler ;
|
||||
|
||||
: start-echo-server ( -- )
|
||||
<echo-server> [ start-server ] in-thread start-server drop ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue