Making with-server take encodings properly

db4
Daniel Ehrenberg 2008-02-25 15:10:14 -06:00
parent 63e04a9b17
commit 278509336d
5 changed files with 13 additions and 13 deletions

View File

@ -1,9 +1,9 @@
USING: io.sockets io.server io kernel math threads
USING: io.sockets io.server io kernel math threads io.encodings.ascii
debugger tools.time prettyprint concurrency.combinators ;
IN: benchmark.sockets
: simple-server ( -- )
7777 local-server "benchmark.sockets" [
7777 local-server "benchmark.sockets" ascii [
read1 CHAR: x = [
stop-server
] [

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: serialize sequences concurrency.messaging
threads io io.server qualified arrays
namespaces kernel ;
namespaces kernel io.encodings.binary ;
QUALIFIED: io.sockets
IN: concurrency.distributed
@ -15,7 +15,7 @@ SYMBOL: local-node ( -- addrspec )
[
local-node set-global
"concurrency.distributed"
[ handle-node-client ] with-server
binary [ handle-node-client ] with-server
] 2curry f spawn drop ;
: start-node ( port -- )

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: assocs kernel namespaces io io.timeouts strings splitting
threads http http.server.responders sequences prettyprint
io.server logging calendar ;
io.server logging calendar io.encodings.latin1 ;
IN: http.server
@ -49,7 +49,7 @@ IN: http.server
\ parse-request NOTICE add-input-logging
: httpd ( port -- )
internet-server "http.server" [
internet-server "http.server" latin1 [
1 minutes stdio get set-timeout
readln [ parse-request ] when*
] with-server ;

View File

@ -44,12 +44,12 @@ PRIVATE>
: internet-server ( port -- seq )
f swap t resolve-host ;
: with-server ( seq service quot -- )
: with-server ( seq service encoding quot -- )
V{ } clone [
servers [
[ server-loop ] curry with-logging
swap servers [
[ server-loop ] 2curry with-logging
] with-variable
] 3curry parallel-each ; inline
] 3curry curry parallel-each ; inline
: stop-server ( -- )
servers get [ dispose ] each ;

View File

@ -1,10 +1,10 @@
USING: listener io.server ;
USING: listener io.server io.encodings.utf8 ;
IN: tty-server
: tty-server ( port -- )
local-server
"tty-server"
[ listener ] with-server ;
utf8 [ listener ] with-server ;
: default-tty-server 9999 tty-server ;