SYMBOL: end
-: (read-array) ( stream -- )
+: (read-array) ( -- )
elements get element-id [
elements get element-syntax read-ber
dup end = [ drop ] [ , (read-array) ] if
: read-array ( -- array ) [ (read-array) ] { } make ;
-: set-case ( -- )
+: set-case ( -- object )
elements get element-newobj
elements get element-objtype {
{ "boolean" [ "\0" = not ] }
USING: io.sockets io kernel math threads io.encodings.ascii
-debugger tools.time prettyprint concurrency.count-downs
-namespaces arrays continuations ;
+io.streams.duplex debugger tools.time prettyprint
+concurrency.count-downs namespaces arrays continuations ;
IN: benchmark.sockets
SYMBOL: counter
! Copyright (C) 2007, 2008 Slava Pestov.\r
! See http://factorcode.org/license.txt for BSD license.\r
-USING: namespaces kernel assocs io.files combinators\r
-arrays io.launcher io http.server.static http.server\r
+USING: namespaces kernel assocs io.files io.streams.duplex\r
+combinators arrays io.launcher io http.server.static http.server\r
http accessors sequences strings math.parser fry ;\r
IN: http.server.cgi\r
\r
] [ ] make
1quotation [ { } make ] append
1quotation %
- \ with-string-input ,
+ \ with-string-reader ,
] [ ] make ;
: unpack-native ( seq str -- seq )
! Copyright (C) 2007 Elie CHAFTARI
! See http://factorcode.org/license.txt for BSD license.
USING: combinators kernel prettyprint io io.timeouts io.server
-sequences namespaces io.sockets continuations calendar io.encodings.ascii ;
+sequences namespaces io.sockets continuations calendar
+io.encodings.ascii io.streams.duplex ;
IN: smtp.server
! Mock SMTP server for testing purposes.
"Starting SMTP server on port " write dup . flush
"127.0.0.1" swap <inet4> ascii <server> [
accept drop [
- default-timeout
+ 1 minutes timeouts
"220 hello\r\n" write flush
process
global [ flush ] bind