]> gitweb.factorcode.org Git - factor.git/commitdiff
Squashed commit of the following:
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 28 Sep 2010 00:12:33 +0000 (19:12 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 28 Sep 2010 00:12:33 +0000 (19:12 -0500)
commit 54b3e19c7407707fabddd53872559c58cd5143d2
Author: Doug Coleman <doug.coleman@gmail.com>
Date:   Mon Sep 27 19:10:15 2010 -0500

    Fix typo

commit 3207516dc93e0e1edc9f119efcc79f4484eab244
Author: Doug Coleman <doug.coleman@gmail.com>
Date:   Mon Sep 27 19:08:30 2010 -0500

    Rename io.servers.connection to io.servers

33 files changed:
basis/channels/remote/remote-docs.factor
basis/concurrency/distributed/distributed-tests.factor
basis/concurrency/distributed/distributed.factor
basis/ftp/server/server-tests.factor
basis/ftp/server/server.factor
basis/furnace/sessions/sessions-tests.factor
basis/http/http-tests.factor
basis/http/server/remapping/remapping.factor
basis/http/server/server-docs.factor
basis/http/server/server.factor
basis/io/servers/authors.txt [new file with mode: 0644]
basis/io/servers/connection/authors.txt [deleted file]
basis/io/servers/connection/connection-docs.factor [deleted file]
basis/io/servers/connection/connection-tests.factor [deleted file]
basis/io/servers/connection/connection.factor [deleted file]
basis/io/servers/connection/summary.txt [deleted file]
basis/io/servers/connection/tags.txt [deleted file]
basis/io/servers/servers-docs.factor [new file with mode: 0644]
basis/io/servers/servers-tests.factor [new file with mode: 0644]
basis/io/servers/servers.factor [new file with mode: 0644]
basis/io/servers/summary.txt [new file with mode: 0644]
basis/io/servers/tags.txt [new file with mode: 0644]
basis/io/sockets/sockets-docs.factor
basis/mime/multipart/multipart-tests.factor
basis/tools/deploy/deploy-tests.factor
extra/fuel/remote/remote.factor
extra/google-tech-talk/google-tech-talk.factor
extra/managed-server/managed-server.factor
extra/time-server/time-server.factor
extra/tty-server/tty-server.factor
extra/webapps/site-watcher/site-watcher.factor
extra/webapps/todo/todo.factor
extra/websites/concatenative/concatenative.factor

index 266d7740561d53d768e281be8e666a7a0af353d9..2215d959a30060109f4849a6ab6593a2b1ae0bba 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2007 Chris Double.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: channels concurrency.distributed help.markup help.syntax
-io.servers.connection ;
+io.servers ;
 IN: channels.remote
 
 HELP: <remote-channel>
index 3a6693c44015b82b3d913b31a9a981380db709e2..ebe5bc5da2c0dfb7ffeed2a0913b1a2b985b33a6 100644 (file)
@@ -1,7 +1,7 @@
 USING: tools.test concurrency.distributed kernel io.files
 io.files.temp io.directories arrays io.sockets system calendar
 combinators threads math sequences concurrency.messaging
-continuations accessors prettyprint io.servers.connection ;
+continuations accessors prettyprint io.servers ;
 FROM: concurrency.messaging => receive send ;
 IN: concurrency.distributed.tests
 
@@ -36,4 +36,4 @@ test-node-server [
         test-node-client "thread-a" <remote-thread> send
         100 seconds receive-timeout
     ] unit-test
-] with-threaded-server
\ No newline at end of file
+] with-threaded-server
index f18f5279ea8bdab9b89f6260b38c651c0be3467d..153f0c9ad63a6dd997bd5c0058dcfe65e3f8d77a 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2005 Chris Double. All Rights Reserved.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: serialize sequences concurrency.messaging threads io
-io.servers.connection io.encodings.binary assocs init
+io.servers io.encodings.binary assocs init
 arrays namespaces kernel accessors ;
 FROM: io.sockets => host-name <inet> with-client ;
 IN: concurrency.distributed
index 2954db0f8b4962bac1f75badb8400c97750c2aa0..fa6afa30cc735234a59811b59a48059c2c179792 100644 (file)
@@ -1,6 +1,6 @@
 USING: calendar ftp.server io.encodings.ascii io.files
 io.files.unique namespaces threads tools.test kernel
-io.servers.connection ftp.client accessors urls
+io.servers ftp.client accessors urls
 io.pathnames io.directories sequences fry io.backend
 continuations ;
 FROM: ftp.client => ftp-get ;
index e6a47c3ffd3e9ebe46a135ae1bf80b1dbb2e49c7..c1508f8ad5886c48846d559085e750f4153fb608 100644 (file)
@@ -5,7 +5,7 @@ combinators.short-circuit concurrency.promises continuations
 destructors ftp io io.directories io.encodings
 io.encodings.8-bit.latin1 io.encodings.binary io.encodings.utf8
 io.files io.files.info io.files.types io.pathnames
-io.servers.connection io.sockets io.streams.string io.timeouts
+io.servers io.sockets io.streams.string io.timeouts
 kernel logging math math.bitwise math.parser namespaces
 sequences simple-tokenizer splitting strings threads
 tools.files unicode.case ;
index 49311ee8913bf563666116577eadf14fab6f50fe..1ac3dbd51aee7c8b9581e4d37c625eb2f8ad74c9 100644 (file)
@@ -1,6 +1,6 @@
 USING: tools.test http furnace.sessions furnace.actions\r
 http.server http.server.responses math namespaces make kernel\r
-accessors io.sockets io.servers.connection prettyprint\r
+accessors io.sockets io.servers prettyprint\r
 io.streams.string io.files io.files.temp io.directories\r
 splitting destructors sequences db db.tuples db.sqlite\r
 continuations urls math.parser furnace furnace.utilities ;\r
index 7be7c43399edd6fa9db5896a0040eb149112efa8..1a74e3fc6d69d6be52c5dc6a13cd9f0fb6696fce 100644 (file)
@@ -205,7 +205,7 @@ Set-Cookie: oo="bar; a=b"; comment="your mom"; httponly=yes
 ! Live-fire exercise
 USING: http.server.static furnace.sessions furnace.alloy
 furnace.actions furnace.auth furnace.auth.login furnace.db
-io.servers.connection io.files io.files.temp io.directories io
+io.servers io.files io.files.temp io.directories io
 threads
 http.server.responses http.server.redirection furnace.redirection
 http.server.dispatchers db.tuples ;
index 36e769731bccd013c91956b1d33ee3e068d3462b..6eed900accf510da3f9bd46e5ca56b7289562de8 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: namespaces assocs kernel io.servers.connection ;
+USING: namespaces assocs kernel io.servers ;
 IN: http.server.remapping
 
 SYMBOL: port-remapping
index 7e8d2309716cca1c24b008283961a91d1b647afb..5d1b231f60914fe6fc185aad7bce889cffb6626a 100644 (file)
@@ -1,5 +1,5 @@
 USING: help.markup help.syntax io.streams.string quotations strings urls
-http vocabs.refresh math io.servers.connection assocs ;
+http vocabs.refresh math io.servers assocs ;
 IN: http.server
 
 HELP: trivial-responder
@@ -109,7 +109,7 @@ ARTICLE: "http.server.variables" "HTTP server variables"
 } ;
 
 ARTICLE: "http.server" "HTTP server"
-"The " { $vocab-link "http.server" } " vocabulary implements an HTTP and HTTPS server on top of " { $vocab-link "io.servers.connection" } "."
+"The " { $vocab-link "http.server" } " vocabulary implements an HTTP and HTTPS server on top of " { $vocab-link "io.servers" } "."
 { $subsections
     "http.server.responders"
     "http.server.requests"
index 9e4a8ac4bfa2ac314164e4ee85a24295f610ca35..c5bc88f81f840724845d370708157246488fb3d6 100644 (file)
@@ -15,7 +15,7 @@ io.encodings.binary
 io.streams.limited
 io.streams.string
 io.streams.throwing
-io.servers.connection
+io.servers
 io.timeouts
 io.crlf
 fry logging logging.insomniac calendar urls urls.encoding
diff --git a/basis/io/servers/authors.txt b/basis/io/servers/authors.txt
new file mode 100644 (file)
index 0000000..1901f27
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
diff --git a/basis/io/servers/connection/authors.txt b/basis/io/servers/connection/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/io/servers/connection/connection-docs.factor b/basis/io/servers/connection/connection-docs.factor
deleted file mode 100644 (file)
index 4dd8efd..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-USING: calendar classes concurrency.semaphores help.markup
-help.syntax io io.sockets io.sockets.secure math quotations ;
-IN: io.servers.connection
-
-ARTICLE: "server-config" "Threaded server configuration"
-"The " { $link threaded-server } " tuple has a variety of slots which can be set before starting the server with " { $link start-server } "."
-{ $subsections
-    "server-config-logging"
-    "server-config-listen"
-    "server-config-limit"
-    "server-config-stream"
-    "server-config-handler"
-} ;
-
-ARTICLE: "server-config-logging" "Logging connections"
-"The " { $snippet "name" } " slot of a threaded server instance should be set to a string naming the logging service name to use. See " { $link "logging" } " for details." ;
-
-ARTICLE: "server-config-listen" "Setting ports to listen on"
-"The " { $snippet "insecure" } " slot of a threaded server instance contains an integer, an address specifier, or a sequence of address specifiers. Integer port numbers are interpreted as an " { $link inet4 } "/" { $link inet6 } " pair listening on all interfaces for given port number. All other address specifiers are interpeted as per " { $link "network-addressing" } "."
-$nl
-"The " { $snippet "secure" } " slot of a threaded server instance is interpreted in the same manner as the " { $snippet "insecure" } " slot, except that secure encrypted connections are then allowed. If this slot is set, the " { $snippet "secure-config" } " slot should also be set to a " { $link secure-config } " instance containing SSL server configuration. See " { $link "ssl-config" } " for details."
-$nl
-"Two utility words for producing address specifiers:"
-{ $subsections
-    local-server
-    internet-server
-} ;
-
-ARTICLE: "server-config-limit" "Limiting connections"
-"The " { $snippet "max-connections" } " slot is initially set to " { $link f } ", which disables connection limiting, but can be set to an integer specifying the maximum number of simultaneous connections."
-$nl
-"Another method to limit connections is to set the " { $snippet "semaphore" } " slot to a " { $link semaphore } ". The server will hold the semaphore while servicing the client connection."
-$nl
-"Setting the " { $snippet "max-connections" } " slot is equivalent to storing a semaphore with this initial count in the " { $snippet "semaphore" } " slot. The " { $snippet "semaphore" } " slot is useful for enforcing a maximum connection count shared between multiple threaded servers. See " { $link "concurrency.semaphores" } " for details." ;
-
-ARTICLE: "server-config-stream" "Client stream parameters"
-"The " { $snippet "encoding" } " and " { $snippet "timeout" } " slots of the threaded server can be set to an encoding descriptor or a " { $link duration } ", respectively. See " { $link "io.encodings" } " and " { $link "io.timeouts" } " for details." ;
-
-ARTICLE: "server-config-handler" "Client handler quotation"
-"The " { $snippet "handler" } " slot of a threaded server instance should be set to a quotation which handles client connections. Client handlers are run in their own thread, with the following variables rebound:"
-{ $list
-    { $link input-stream }
-    { $link output-stream }
-    { $link local-address }
-    { $link remote-address }
-    { $link threaded-server }
-}
-"An alternate way to implement client handlers is to subclass " { $link threaded-server } ", and define a method on " { $link handle-client* } "."
-$nl
-"The two methods are equivalent, representing a functional versus an object-oriented approach to the problem." ;
-
-ARTICLE: "server-examples" "Threaded server examples"
-"The " { $vocab-link "time-server" } " vocabulary implements a simple threaded server which sends the current time to the client. The " { $vocab-link "concurrency.distributed" } ", " { $vocab-link "ftp.server" } ", and " { $vocab-link "http.server" } " vocabularies demonstrate more complex usage of the threaded server library." ;
-
-ARTICLE: "io.servers.connection" "Threaded servers"
-"The " { $vocab-link "io.servers.connection" } " vocabulary implements a generic server abstraction for " { $link "network-connection" } ". A set of threads listen for connections, and additional threads are spawned for each client connection. In addition to this basic functionality, it provides some advanced features such as logging, connection limits and secure socket support."
-{ $subsections "server-examples" }
-"Creating threaded servers with client handler quotations:"
-{ $subsections <threaded-server> }
-"Client handlers can also be implemented by subclassing a threaded server; see " { $link "server-config-handler" } " for details:"
-{ $subsections
-    threaded-server
-    new-threaded-server
-    handle-client*
-}
-"The server must be configured before it can be started." 
-{ $subsections "server-config" }
-"Starting the server:"
-{ $subsections start-server }
-"Stopping the server:"
-{ $subsections stop-server }
-"Waiting for the server to stop:"
-{ $subsections wait-for-server }
-"Combinator for running a server:"
-{ $subsections with-threaded-server }
-"From within the dynamic scope of a client handler, several words can be used to interact with the threaded server:"
-{ $subsections
-    stop-this-server
-    secure-port
-    insecure-port
-}
-"Additionally, the " { $link local-address } " and "
-{ $subsections remote-address } " variables are set, as in " { $link with-client } "." ;
-
-ABOUT: "io.servers.connection"
-
-HELP: threaded-server
-{ $var-description "In client handlers, stores the current threaded server instance." }
-{ $class-description "The class of threaded servers. New instances are created with " { $link <threaded-server> } ". This class may be subclassed, and instances of subclasses should be created with " { $link new-threaded-server } ". See " { $link "server-config" } " for slot documentation." } ;
-
-HELP: new-threaded-server
-{ $values { "encoding" "an encoding descriptor" } { "class" class } { "threaded-server" threaded-server } }
-{ $description "Creates a new instance of a subclass of " { $link threaded-server } ". Subclasses can implement the " { $link handle-client* } " generic word." } ;
-
-HELP: <threaded-server>
-{ $values { "encoding" "an encoding descriptor" } { "threaded-server" threaded-server } }
-{ $description "Creates a new threaded server with streams encoded " { $snippet "encoding" } ". Its slots should be filled in as per " { $link "server-config" } ", before " { $link start-server } " is called to begin waiting for connections." } ;
-
-HELP: remote-address
-{ $var-description "Variable holding the address specifier of the current client connection. See " { $link "network-addressing" } "." } ;
-
-HELP: handle-client*
-{ $values { "threaded-server" threaded-server } }
-{ $contract "Handles a client connection. Default implementation calls quotation stored in the " { $snippet "handler" } " slot of the threaded server." } ;
-
-HELP: start-server
-{ $values { "threaded-server" threaded-server } }
-{ $description "Starts a threaded server and returns after the server is fully running. Throws an error if any of the ports cannot be aquired." }
-{ $notes "Use " { $link stop-server } " or " { $link stop-this-server } " to stop the server." } ;
-
-HELP: stop-server
-{ $values { "threaded-server" threaded-server } }
-{ $description "Stops a threaded server, preventing it from accepting any more connections. All client connections which have already been opened continue to be serviced." } ;
-
-HELP: wait-for-server
-{ $values { "threaded-server" threaded-server } }
-{ $description "Waits for a threaded server to stop serving new connections." } ;
-
-HELP: stop-this-server
-{ $description "Stops the current threaded server, preventing it from accepting any more connections. All client connections which have already been opened continue to be serviced." } ;
-
-HELP: with-threaded-server
-{ $values
-    { "threaded-server" threaded-server } { "quot" quotation }    
-}
-{ $description "Runs a server and calls a quotation, stopping the server once the quotation returns." } ;
-
-HELP: secure-port
-{ $values { "n/f" { $maybe integer } } }
-{ $description "Outputs one of the port numbers on which the current threaded server accepts secure socket connections. Outputs " { $link f } " if the current threaded server does not accept secure socket connections." }
-{ $notes "Can only be used from the dynamic scope of a " { $link handle-client* } " call." } ;
-
-HELP: insecure-port
-{ $values { "n/f" { $maybe integer } } }
-{ $description "Outputs one of the port numbers on which the current threaded server accepts ordinary socket connections. Outputs " { $link f } " if the current threaded server does not accept ordinary socket connections." }
-{ $notes "Can only be used from the dynamic scope of a " { $link handle-client* } " call." } ;
diff --git a/basis/io/servers/connection/connection-tests.factor b/basis/io/servers/connection/connection-tests.factor
deleted file mode 100644 (file)
index 72f4706..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-USING: accessors calendar concurrency.promises fry io
-io.encodings.ascii io.servers.connection
-io.servers.connection.private io.sockets kernel namespaces
-sequences threads tools.test ;
-IN: io.servers.connection
-
-[ t ] [ ascii <threaded-server> listen-on empty? ] unit-test
-
-[ f ] [
-    ascii <threaded-server>
-        25 internet-server >>insecure
-    listen-on
-    empty?
-] unit-test
-
-[ t ] [
-    T{ inet4 f "1.2.3.4" 1234 } T{ inet4 f "1.2.3.5" 1235 }
-    [ log-connection ] 2keep
-    [ remote-address get = ] [ local-address get = ] bi*
-    and
-] unit-test
-
-[ ] [ ascii <threaded-server> init-server drop ] unit-test
-
-[ 10 ] [
-    ascii <threaded-server>
-        10 >>max-connections
-    init-server semaphore>> count>> 
-] unit-test
-
-[ "Hello world." ] [
-    ascii <threaded-server>
-        5 >>max-connections
-        0 >>insecure
-        [ "Hello world." write stop-this-server ] >>handler
-    [
-        "localhost" insecure-port <inet> ascii <client> drop stream-contents
-    ] with-threaded-server
-] unit-test
-
-[ ] [
-    ascii <threaded-server>
-        5 >>max-connections
-        0 >>insecure
-    start-server [ '[ _ wait-for-server ] in-thread ] [ stop-server ] bi
-] unit-test
diff --git a/basis/io/servers/connection/connection.factor b/basis/io/servers/connection/connection.factor
deleted file mode 100644 (file)
index 940b20f..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-! Copyright (C) 2003, 2010 Slava Pestov, Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays calendar combinators
-combinators.short-circuit concurrency.combinators
-concurrency.count-downs concurrency.flags
-concurrency.semaphores continuations debugger destructors fry
-io io.sockets io.sockets.secure io.streams.duplex io.styles
-io.timeouts kernel logging make math math.parser namespaces
-present prettyprint random sequences sets strings threads ;
-FROM: namespaces => set ;
-IN: io.servers.connection
-
-TUPLE: threaded-server < identity-tuple
-name
-log-level
-secure
-insecure
-secure-config
-servers
-max-connections
-semaphore
-timeout
-encoding
-handler
-server-stopped
-secure-context ;
-
-SYMBOL: running-servers
-running-servers [ HS{ } clone ] initialize
-
-ERROR: server-already-running threaded-server ;
-
-ERROR: server-not-running threaded-server ;
-
-<PRIVATE
-
-: must-be-running ( threaded-server -- threaded-server )
-    dup running-servers get in? [ server-not-running ] unless ;
-
-: must-not-be-running ( threaded-server -- threaded-server )
-    dup running-servers get in? [ server-already-running ] when ;
-
-: add-running-server ( threaded-server -- )
-    must-not-be-running
-    running-servers get adjoin ;
-
-: remove-running-server ( threaded-server -- )
-    must-be-running
-    running-servers get delete ;
-
-PRIVATE>
-
-: local-server ( port -- addrspec ) "localhost" swap <inet> ;
-
-: internet-server ( port -- addrspec ) f swap <inet> ;
-
-: new-threaded-server ( encoding class -- threaded-server )
-    new
-        "server" >>name
-        DEBUG >>log-level
-        <secure-config> >>secure-config
-        1 minutes >>timeout
-        [ "No handler quotation" throw ] >>handler
-        swap >>encoding ;
-
-: <threaded-server> ( encoding -- threaded-server )
-    threaded-server new-threaded-server ;
-
-GENERIC: handle-client* ( threaded-server -- )
-
-<PRIVATE
-
-GENERIC: >insecure ( obj -- obj )
-
-M: inet >insecure 1array ;
-M: inet4 >insecure 1array ;
-M: inet6 >insecure 1array ;
-M: local >insecure 1array ;
-M: integer >insecure internet-server 1array ;
-M: string >insecure internet-server 1array ;
-M: array >insecure [ >insecure ] map ;
-M: f >insecure ;
-
-: >secure ( addrspec -- addrspec' )
-    >insecure
-    [ dup secure? [ <secure> ] unless ] map ;
-
-: listen-on ( threaded-server -- addrspecs )
-    [ secure>> >secure ] [ insecure>> >insecure ] bi append
-    [ resolve-host ] map concat ;
-
-: accepted-connection ( remote local -- )
-    [
-        [ "remote: " % present % ", " % ]
-        [ "local: " % present % ]
-        bi*
-    ] "" make
-    \ accepted-connection NOTICE log-message ;
-
-: log-connection ( remote local -- )
-    [ accepted-connection ]
-    [ [ remote-address set ] [ local-address set ] bi* ]
-    2bi ;
-
-M: threaded-server handle-client* handler>> call( -- ) ;
-
-: handle-client ( client remote local -- )
-    '[
-        _ _ log-connection
-        threaded-server get
-        [ timeout>> timeouts ] [ handle-client* ] bi
-    ] with-stream ;
-
-\ handle-client NOTICE add-error-logging
-
-: client-thread-name ( addrspec -- string )
-    [ threaded-server get name>> ] dip
-    unparse-short " connection from " glue ;
-
-: (accept-connection) ( server -- )
-    [ accept ] [ addr>> ] bi
-    [ '[ _ _ _ handle-client ] ]
-    [ drop client-thread-name ] 2bi
-    spawn drop ;
-
-: accept-connection ( server -- )
-    threaded-server get semaphore>>
-    [ [ (accept-connection) ] with-semaphore ]
-    [ (accept-connection) ]
-    if* ;
-
-: with-existing-secure-context ( threaded-server quot -- )
-    [ secure-context>> secure-context ] dip with-variable ; inline
-
-: accept-loop ( server -- )
-    [ accept-connection ] [ accept-loop ] bi ;
-
-: start-accept-loop ( threaded-server server -- )
-    '[ _ accept-loop ] with-existing-secure-context ;
-
-\ start-accept-loop NOTICE add-error-logging
-
-: create-secure-context ( threaded-server -- threaded-server )
-    dup secure>> [
-        dup secure-config>> <secure-context> >>secure-context
-    ] when ;
-
-: init-server ( threaded-server -- threaded-server )
-    create-secure-context
-    <flag> >>server-stopped
-    dup semaphore>> [
-        dup max-connections>> [
-            <semaphore> >>semaphore
-        ] when*
-    ] unless ;
-
-ERROR: no-ports-configured threaded-server ;
-
-: (make-servers) ( theaded-server addrspecs -- servers )
-    swap encoding>>
-    '[ [ _ <server> |dispose ] map ] with-destructors ;
-
-: set-servers ( threaded-server -- threaded-server )
-    dup [
-        dup dup listen-on [ no-ports-configured ] [ (make-servers) ] if-empty
-        >>servers
-    ] with-existing-secure-context ;
-
-: server-thread-name ( threaded-server addrspec -- string )
-    [ name>> ] [ addr>> present ] bi* " server on " glue ;
-
-PRIVATE>
-
-: start-server ( threaded-server -- threaded-server )
-    init-server
-    [
-        dup threaded-server [
-            [ ] [ name>> ] bi
-            [
-                set-servers
-                dup add-running-server
-                dup servers>>
-                [
-                    [ '[ _ _ [ start-accept-loop ] with-disposal ] ]
-                    [ server-thread-name ] 2bi spawn drop
-                ] with each
-            ] with-logging
-        ] with-variable
-    ] keep ;
-
-: server-running? ( threaded-server -- ? )
-    server-stopped>> [ value>> not ] [ f ] if* ;
-
-: stop-server ( threaded-server -- )
-    dup server-running? [
-        [ remove-running-server ]
-        [
-            [
-                [ secure-context>> [ &dispose drop ] when* ]
-                [ [ f ] change-servers drop dispose-each ] bi
-            ] with-destructors
-        ]
-        [ server-stopped>> raise-flag ] tri
-    ] [
-        drop
-    ] if ;
-
-: stop-this-server ( -- )
-    threaded-server get stop-server ;
-
-: wait-for-server ( threaded-server -- )
-    server-stopped>> wait-for-flag ;
-
-: with-threaded-server ( threaded-server quot -- )
-    [ start-server ] dip over
-    '[
-        [ _ threaded-server _ with-variable ]
-        [ _ stop-server ]
-        [ ] cleanup
-    ] call ; inline
-
-<PRIVATE
-
-: first-port ( quot -- n/f )
-    [ threaded-server get servers>> ] dip
-    filter [ f ] [ first addr>> port>> ] if-empty ; inline
-
-PRIVATE>
-
-: secure-port ( -- n/f ) [ addr>> secure? ] first-port ;
-
-: insecure-port ( -- n/f ) [ addr>> secure? not ] first-port ;
-
-: secure-addr ( -- inet )
-    threaded-server get servers>> [ addr>> secure? ] filter random ;
-
-: insecure-addr ( -- inet )
-    threaded-server get servers>> [ addr>> secure? not ] filter random addr>> ;
-    
-: server. ( threaded-server -- )
-    [ [ "=== " write name>> ] [ ] bi write-object nl ]
-    [ servers>> [ addr>> present print ] each ] bi ;
-
-: all-servers ( -- sequence )
-    running-servers get-global members ;
-
-: get-servers-named ( string -- sequence )
-    [ all-servers ] dip '[ name>> _ = ] filter ;
-    
-: servers. ( -- )
-    all-servers [ server. ] each ;
-
-: stop-all-servers ( -- )
-    all-servers [ stop-server ] each ;
diff --git a/basis/io/servers/connection/summary.txt b/basis/io/servers/connection/summary.txt
deleted file mode 100644 (file)
index 8269ecf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Multi-threaded TCP/IP servers
diff --git a/basis/io/servers/connection/tags.txt b/basis/io/servers/connection/tags.txt
deleted file mode 100644 (file)
index 992ae12..0000000
+++ /dev/null
@@ -1 +0,0 @@
-network
diff --git a/basis/io/servers/servers-docs.factor b/basis/io/servers/servers-docs.factor
new file mode 100644 (file)
index 0000000..051dfad
--- /dev/null
@@ -0,0 +1,136 @@
+USING: calendar classes concurrency.semaphores help.markup
+help.syntax io io.sockets io.sockets.secure math quotations ;
+IN: io.servers
+
+ARTICLE: "server-config" "Threaded server configuration"
+"The " { $link threaded-server } " tuple has a variety of slots which can be set before starting the server with " { $link start-server } "."
+{ $subsections
+    "server-config-logging"
+    "server-config-listen"
+    "server-config-limit"
+    "server-config-stream"
+    "server-config-handler"
+} ;
+
+ARTICLE: "server-config-logging" "Logging connections"
+"The " { $snippet "name" } " slot of a threaded server instance should be set to a string naming the logging service name to use. See " { $link "logging" } " for details." ;
+
+ARTICLE: "server-config-listen" "Setting ports to listen on"
+"The " { $snippet "insecure" } " slot of a threaded server instance contains an integer, an address specifier, or a sequence of address specifiers. Integer port numbers are interpreted as an " { $link inet4 } "/" { $link inet6 } " pair listening on all interfaces for given port number. All other address specifiers are interpeted as per " { $link "network-addressing" } "."
+$nl
+"The " { $snippet "secure" } " slot of a threaded server instance is interpreted in the same manner as the " { $snippet "insecure" } " slot, except that secure encrypted connections are then allowed. If this slot is set, the " { $snippet "secure-config" } " slot should also be set to a " { $link secure-config } " instance containing SSL server configuration. See " { $link "ssl-config" } " for details."
+$nl
+"Two utility words for producing address specifiers:"
+{ $subsections
+    local-server
+    internet-server
+} ;
+
+ARTICLE: "server-config-limit" "Limiting connections"
+"The " { $snippet "max-connections" } " slot is initially set to " { $link f } ", which disables connection limiting, but can be set to an integer specifying the maximum number of simultaneous connections."
+$nl
+"Another method to limit connections is to set the " { $snippet "semaphore" } " slot to a " { $link semaphore } ". The server will hold the semaphore while servicing the client connection."
+$nl
+"Setting the " { $snippet "max-connections" } " slot is equivalent to storing a semaphore with this initial count in the " { $snippet "semaphore" } " slot. The " { $snippet "semaphore" } " slot is useful for enforcing a maximum connection count shared between multiple threaded servers. See " { $link "concurrency.semaphores" } " for details." ;
+
+ARTICLE: "server-config-stream" "Client stream parameters"
+"The " { $snippet "encoding" } " and " { $snippet "timeout" } " slots of the threaded server can be set to an encoding descriptor or a " { $link duration } ", respectively. See " { $link "io.encodings" } " and " { $link "io.timeouts" } " for details." ;
+
+ARTICLE: "server-config-handler" "Client handler quotation"
+"The " { $snippet "handler" } " slot of a threaded server instance should be set to a quotation which handles client connections. Client handlers are run in their own thread, with the following variables rebound:"
+{ $list
+    { $link input-stream }
+    { $link output-stream }
+    { $link local-address }
+    { $link remote-address }
+    { $link threaded-server }
+}
+"An alternate way to implement client handlers is to subclass " { $link threaded-server } ", and define a method on " { $link handle-client* } "."
+$nl
+"The two methods are equivalent, representing a functional versus an object-oriented approach to the problem." ;
+
+ARTICLE: "server-examples" "Threaded server examples"
+"The " { $vocab-link "time-server" } " vocabulary implements a simple threaded server which sends the current time to the client. The " { $vocab-link "concurrency.distributed" } ", " { $vocab-link "ftp.server" } ", and " { $vocab-link "http.server" } " vocabularies demonstrate more complex usage of the threaded server library." ;
+
+ARTICLE: "io.servers" "Threaded servers"
+"The " { $vocab-link "io.servers" } " vocabulary implements a generic server abstraction for " { $link "network-connection" } ". A set of threads listen for connections, and additional threads are spawned for each client connection. In addition to this basic functionality, it provides some advanced features such as logging, connection limits and secure socket support."
+{ $subsections "server-examples" }
+"Creating threaded servers with client handler quotations:"
+{ $subsections <threaded-server> }
+"Client handlers can also be implemented by subclassing a threaded server; see " { $link "server-config-handler" } " for details:"
+{ $subsections
+    threaded-server
+    new-threaded-server
+    handle-client*
+}
+"The server must be configured before it can be started." 
+{ $subsections "server-config" }
+"Starting the server:"
+{ $subsections start-server }
+"Stopping the server:"
+{ $subsections stop-server }
+"Waiting for the server to stop:"
+{ $subsections wait-for-server }
+"Combinator for running a server:"
+{ $subsections with-threaded-server }
+"From within the dynamic scope of a client handler, several words can be used to interact with the threaded server:"
+{ $subsections
+    stop-this-server
+    secure-port
+    insecure-port
+}
+"Additionally, the " { $link local-address } " and "
+{ $subsections remote-address } " variables are set, as in " { $link with-client } "." ;
+
+ABOUT: "io.servers"
+
+HELP: threaded-server
+{ $var-description "In client handlers, stores the current threaded server instance." }
+{ $class-description "The class of threaded servers. New instances are created with " { $link <threaded-server> } ". This class may be subclassed, and instances of subclasses should be created with " { $link new-threaded-server } ". See " { $link "server-config" } " for slot documentation." } ;
+
+HELP: new-threaded-server
+{ $values { "encoding" "an encoding descriptor" } { "class" class } { "threaded-server" threaded-server } }
+{ $description "Creates a new instance of a subclass of " { $link threaded-server } ". Subclasses can implement the " { $link handle-client* } " generic word." } ;
+
+HELP: <threaded-server>
+{ $values { "encoding" "an encoding descriptor" } { "threaded-server" threaded-server } }
+{ $description "Creates a new threaded server with streams encoded " { $snippet "encoding" } ". Its slots should be filled in as per " { $link "server-config" } ", before " { $link start-server } " is called to begin waiting for connections." } ;
+
+HELP: remote-address
+{ $var-description "Variable holding the address specifier of the current client connection. See " { $link "network-addressing" } "." } ;
+
+HELP: handle-client*
+{ $values { "threaded-server" threaded-server } }
+{ $contract "Handles a client connection. Default implementation calls quotation stored in the " { $snippet "handler" } " slot of the threaded server." } ;
+
+HELP: start-server
+{ $values { "threaded-server" threaded-server } }
+{ $description "Starts a threaded server and returns after the server is fully running. Throws an error if any of the ports cannot be aquired." }
+{ $notes "Use " { $link stop-server } " or " { $link stop-this-server } " to stop the server." } ;
+
+HELP: stop-server
+{ $values { "threaded-server" threaded-server } }
+{ $description "Stops a threaded server, preventing it from accepting any more connections. All client connections which have already been opened continue to be serviced." } ;
+
+HELP: wait-for-server
+{ $values { "threaded-server" threaded-server } }
+{ $description "Waits for a threaded server to stop serving new connections." } ;
+
+HELP: stop-this-server
+{ $description "Stops the current threaded server, preventing it from accepting any more connections. All client connections which have already been opened continue to be serviced." } ;
+
+HELP: with-threaded-server
+{ $values
+    { "threaded-server" threaded-server } { "quot" quotation }    
+}
+{ $description "Runs a server and calls a quotation, stopping the server once the quotation returns." } ;
+
+HELP: secure-port
+{ $values { "n/f" { $maybe integer } } }
+{ $description "Outputs one of the port numbers on which the current threaded server accepts secure socket connections. Outputs " { $link f } " if the current threaded server does not accept secure socket connections." }
+{ $notes "Can only be used from the dynamic scope of a " { $link handle-client* } " call." } ;
+
+HELP: insecure-port
+{ $values { "n/f" { $maybe integer } } }
+{ $description "Outputs one of the port numbers on which the current threaded server accepts ordinary socket connections. Outputs " { $link f } " if the current threaded server does not accept ordinary socket connections." }
+{ $notes "Can only be used from the dynamic scope of a " { $link handle-client* } " call." } ;
diff --git a/basis/io/servers/servers-tests.factor b/basis/io/servers/servers-tests.factor
new file mode 100644 (file)
index 0000000..bcba7f7
--- /dev/null
@@ -0,0 +1,46 @@
+USING: accessors calendar concurrency.promises fry io
+io.encodings.ascii io.servers
+io.servers.private io.sockets kernel namespaces
+sequences threads tools.test ;
+IN: io.servers
+
+[ t ] [ ascii <threaded-server> listen-on empty? ] unit-test
+
+[ f ] [
+    ascii <threaded-server>
+        25 internet-server >>insecure
+    listen-on
+    empty?
+] unit-test
+
+[ t ] [
+    T{ inet4 f "1.2.3.4" 1234 } T{ inet4 f "1.2.3.5" 1235 }
+    [ log-connection ] 2keep
+    [ remote-address get = ] [ local-address get = ] bi*
+    and
+] unit-test
+
+[ ] [ ascii <threaded-server> init-server drop ] unit-test
+
+[ 10 ] [
+    ascii <threaded-server>
+        10 >>max-connections
+    init-server semaphore>> count>> 
+] unit-test
+
+[ "Hello world." ] [
+    ascii <threaded-server>
+        5 >>max-connections
+        0 >>insecure
+        [ "Hello world." write stop-this-server ] >>handler
+    [
+        "localhost" insecure-port <inet> ascii <client> drop stream-contents
+    ] with-threaded-server
+] unit-test
+
+[ ] [
+    ascii <threaded-server>
+        5 >>max-connections
+        0 >>insecure
+    start-server [ '[ _ wait-for-server ] in-thread ] [ stop-server ] bi
+] unit-test
diff --git a/basis/io/servers/servers.factor b/basis/io/servers/servers.factor
new file mode 100644 (file)
index 0000000..66d0112
--- /dev/null
@@ -0,0 +1,254 @@
+! Copyright (C) 2003, 2010 Slava Pestov, Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays calendar combinators
+combinators.short-circuit concurrency.combinators
+concurrency.count-downs concurrency.flags
+concurrency.semaphores continuations debugger destructors fry
+io io.sockets io.sockets.secure io.streams.duplex io.styles
+io.timeouts kernel logging make math math.parser namespaces
+present prettyprint random sequences sets strings threads ;
+FROM: namespaces => set ;
+IN: io.servers
+
+TUPLE: threaded-server < identity-tuple
+name
+log-level
+secure
+insecure
+secure-config
+servers
+max-connections
+semaphore
+timeout
+encoding
+handler
+server-stopped
+secure-context ;
+
+SYMBOL: running-servers
+running-servers [ HS{ } clone ] initialize
+
+ERROR: server-already-running threaded-server ;
+
+ERROR: server-not-running threaded-server ;
+
+<PRIVATE
+
+: must-be-running ( threaded-server -- threaded-server )
+    dup running-servers get in? [ server-not-running ] unless ;
+
+: must-not-be-running ( threaded-server -- threaded-server )
+    dup running-servers get in? [ server-already-running ] when ;
+
+: add-running-server ( threaded-server -- )
+    must-not-be-running
+    running-servers get adjoin ;
+
+: remove-running-server ( threaded-server -- )
+    must-be-running
+    running-servers get delete ;
+
+PRIVATE>
+
+: local-server ( port -- addrspec ) "localhost" swap <inet> ;
+
+: internet-server ( port -- addrspec ) f swap <inet> ;
+
+: new-threaded-server ( encoding class -- threaded-server )
+    new
+        "server" >>name
+        DEBUG >>log-level
+        <secure-config> >>secure-config
+        1 minutes >>timeout
+        [ "No handler quotation" throw ] >>handler
+        swap >>encoding ;
+
+: <threaded-server> ( encoding -- threaded-server )
+    threaded-server new-threaded-server ;
+
+GENERIC: handle-client* ( threaded-server -- )
+
+<PRIVATE
+
+GENERIC: >insecure ( obj -- obj )
+
+M: inet >insecure 1array ;
+M: inet4 >insecure 1array ;
+M: inet6 >insecure 1array ;
+M: local >insecure 1array ;
+M: integer >insecure internet-server 1array ;
+M: string >insecure internet-server 1array ;
+M: array >insecure [ >insecure ] map ;
+M: f >insecure ;
+
+: >secure ( addrspec -- addrspec' )
+    >insecure
+    [ dup secure? [ <secure> ] unless ] map ;
+
+: listen-on ( threaded-server -- addrspecs )
+    [ secure>> >secure ] [ insecure>> >insecure ] bi append
+    [ resolve-host ] map concat ;
+
+: accepted-connection ( remote local -- )
+    [
+        [ "remote: " % present % ", " % ]
+        [ "local: " % present % ]
+        bi*
+    ] "" make
+    \ accepted-connection NOTICE log-message ;
+
+: log-connection ( remote local -- )
+    [ accepted-connection ]
+    [ [ remote-address set ] [ local-address set ] bi* ]
+    2bi ;
+
+M: threaded-server handle-client* handler>> call( -- ) ;
+
+: handle-client ( client remote local -- )
+    '[
+        _ _ log-connection
+        threaded-server get
+        [ timeout>> timeouts ] [ handle-client* ] bi
+    ] with-stream ;
+
+\ handle-client NOTICE add-error-logging
+
+: client-thread-name ( addrspec -- string )
+    [ threaded-server get name>> ] dip
+    unparse-short " connection from " glue ;
+
+: (accept-connection) ( server -- )
+    [ accept ] [ addr>> ] bi
+    [ '[ _ _ _ handle-client ] ]
+    [ drop client-thread-name ] 2bi
+    spawn drop ;
+
+: accept-connection ( server -- )
+    threaded-server get semaphore>>
+    [ [ (accept-connection) ] with-semaphore ]
+    [ (accept-connection) ]
+    if* ;
+
+: with-existing-secure-context ( threaded-server quot -- )
+    [ secure-context>> secure-context ] dip with-variable ; inline
+
+: accept-loop ( server -- )
+    [ accept-connection ] [ accept-loop ] bi ;
+
+: start-accept-loop ( threaded-server server -- )
+    '[ _ accept-loop ] with-existing-secure-context ;
+
+\ start-accept-loop NOTICE add-error-logging
+
+: create-secure-context ( threaded-server -- threaded-server )
+    dup secure>> [
+        dup secure-config>> <secure-context> >>secure-context
+    ] when ;
+
+: init-server ( threaded-server -- threaded-server )
+    create-secure-context
+    <flag> >>server-stopped
+    dup semaphore>> [
+        dup max-connections>> [
+            <semaphore> >>semaphore
+        ] when*
+    ] unless ;
+
+ERROR: no-ports-configured threaded-server ;
+
+: (make-servers) ( theaded-server addrspecs -- servers )
+    swap encoding>>
+    '[ [ _ <server> |dispose ] map ] with-destructors ;
+
+: set-servers ( threaded-server -- threaded-server )
+    dup [
+        dup dup listen-on [ no-ports-configured ] [ (make-servers) ] if-empty
+        >>servers
+    ] with-existing-secure-context ;
+
+: server-thread-name ( threaded-server addrspec -- string )
+    [ name>> ] [ addr>> present ] bi* " server on " glue ;
+
+PRIVATE>
+
+: start-server ( threaded-server -- threaded-server )
+    init-server
+    [
+        dup threaded-server [
+            [ ] [ name>> ] bi
+            [
+                set-servers
+                dup add-running-server
+                dup servers>>
+                [
+                    [ '[ _ _ [ start-accept-loop ] with-disposal ] ]
+                    [ server-thread-name ] 2bi spawn drop
+                ] with each
+            ] with-logging
+        ] with-variable
+    ] keep ;
+
+: server-running? ( threaded-server -- ? )
+    server-stopped>> [ value>> not ] [ f ] if* ;
+
+: stop-server ( threaded-server -- )
+    dup server-running? [
+        [ remove-running-server ]
+        [
+            [
+                [ secure-context>> [ &dispose drop ] when* ]
+                [ [ f ] change-servers drop dispose-each ] bi
+            ] with-destructors
+        ]
+        [ server-stopped>> raise-flag ] tri
+    ] [
+        drop
+    ] if ;
+
+: stop-this-server ( -- )
+    threaded-server get stop-server ;
+
+: wait-for-server ( threaded-server -- )
+    server-stopped>> wait-for-flag ;
+
+: with-threaded-server ( threaded-server quot -- )
+    [ start-server ] dip over
+    '[
+        [ _ threaded-server _ with-variable ]
+        [ _ stop-server ]
+        [ ] cleanup
+    ] call ; inline
+
+<PRIVATE
+
+: first-port ( quot -- n/f )
+    [ threaded-server get servers>> ] dip
+    filter [ f ] [ first addr>> port>> ] if-empty ; inline
+
+PRIVATE>
+
+: secure-port ( -- n/f ) [ addr>> secure? ] first-port ;
+
+: insecure-port ( -- n/f ) [ addr>> secure? not ] first-port ;
+
+: secure-addr ( -- inet )
+    threaded-server get servers>> [ addr>> secure? ] filter random ;
+
+: insecure-addr ( -- inet )
+    threaded-server get servers>> [ addr>> secure? not ] filter random addr>> ;
+    
+: server. ( threaded-server -- )
+    [ [ "=== " write name>> ] [ ] bi write-object nl ]
+    [ servers>> [ addr>> present print ] each ] bi ;
+
+: all-servers ( -- sequence )
+    running-servers get-global members ;
+
+: get-servers-named ( string -- sequence )
+    [ all-servers ] dip '[ name>> _ = ] filter ;
+    
+: servers. ( -- )
+    all-servers [ server. ] each ;
+
+: stop-all-servers ( -- )
+    all-servers [ stop-server ] each ;
diff --git a/basis/io/servers/summary.txt b/basis/io/servers/summary.txt
new file mode 100644 (file)
index 0000000..8269ecf
--- /dev/null
@@ -0,0 +1 @@
+Multi-threaded TCP/IP servers
diff --git a/basis/io/servers/tags.txt b/basis/io/servers/tags.txt
new file mode 100644 (file)
index 0000000..992ae12
--- /dev/null
@@ -0,0 +1 @@
+network
index d0977dd3d0ed3628934e12254e4a6535407e5717..95ad57a46da693c8d47ea3e4c82655723f4e132f 100644 (file)
@@ -52,7 +52,7 @@ $nl
     { { $link inet4 } " - a TCP/IP connection to an IPv4 address and port number; no name lookup is performed" }
     { { $link inet6 } " - a TCP/IP connection to an IPv6 address and port number; no name lookup is performed" }
 }
-"The " { $vocab-link "io.servers.connection" } " library defines high-level wrappers around " { $link <server> } " which makes it easy to listen for IPv4, IPv6 and secure socket connections simultaneously, perform logging, and optionally only allow connections from the loopback interface."
+"The " { $vocab-link "io.servers" } " library defines high-level wrappers around " { $link <server> } " which makes it easy to listen for IPv4, IPv6 and secure socket connections simultaneously, perform logging, and optionally only allow connections from the loopback interface."
 $nl
 "The " { $vocab-link "io.sockets.secure" } " vocabulary implements secure, encrypted sockets via SSL and TLS." ;
 
@@ -170,7 +170,7 @@ HELP: <server>
     { $code "f 1234 <inet> resolve-host" }
     "To start a server which listens for connections from the loopback interface only, use an address specifier returned by the following code, where 1234 is the desired port number:"
     { $code "\"localhost\" 1234 <inet> resolve-host" }
-    "Since " { $link resolve-host } " can return multiple address specifiers, your server code must listen on them all to work properly. The " { $vocab-link "io.servers.connection" } " vocabulary can be used to help with this."
+    "Since " { $link resolve-host } " can return multiple address specifiers, your server code must listen on them all to work properly. The " { $vocab-link "io.servers" } " vocabulary can be used to help with this."
     $nl
     "To start a TCP/IP server which listens for connections on a randomly-assigned port, set the port number in the address specifier to 0, and then read the " { $snippet "addr" } " slot of the server instance to obtain the actual port number it is listening on:"
     { $unchecked-example
index 6c3094fe2217e43b27a7eee36f8738d4a35071f5..bfeb1335ee0e1c3339365f69ff9c7507306f5634 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs continuations fry http.server io
 io.encodings.ascii io.files io.files.unique
-io.servers.connection io.streams.duplex io.streams.string
+io.servers io.streams.duplex io.streams.string
 kernel math.ranges mime.multipart multiline namespaces random
 sequences strings threads tools.test ;
 IN: mime.multipart.tests
index fa446ad44cf6b4bfdc5f00608e095af3d59a0702..e8888717ab1804f49cffcbd7566d46b34c2e44ee 100644 (file)
@@ -52,7 +52,7 @@ os macosx? [
 ] each
 
 USING: http.client http.server http.server.dispatchers
-http.server.responses http.server.static io.servers.connection ;
+http.server.responses http.server.static io.servers ;
 
 SINGLETON: quit-responder
 
index a8007bd858756f107d4d8c69100531faf71cff42..e7b797fc199b811d0a429c0135f56205265e7dc9 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors debugger io io.encodings.utf8 io.servers.connection
+USING: accessors debugger io io.encodings.utf8 io.servers
 kernel listener math namespaces ;
-
 IN: fuel.remote
 
 <PRIVATE
index 02d0bedb2cb6738eeaf2754161ce6154dab662ee..f7d89c905030e2bf001bec5836a6abf7edba06eb 100644 (file)
@@ -359,7 +359,7 @@ CONSTANT: google-slides
     }
     { $slide "Example: time server"
         { $vocab-link "time-server" }
-        { "Demonstrates " { $vocab-link "io.servers.connection" } " vocabulary, threads" }
+        { "Demonstrates " { $vocab-link "io.servers" } " vocabulary, threads" }
     }
     { $slide "Example: what is my IP?"
         { $vocab-link "webapps.ip" }
index d62604476623418bd3834773827d7482d3c5cebd..3d4177988eaf808830b5a14bd90207db8d890d66 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs calendar continuations destructors io
-io.encodings.binary io.servers.connection io.sockets
+io.encodings.binary io.servers io.sockets
 io.streams.duplex fry kernel locals math math.ranges multiline
 namespaces prettyprint random sequences sets splitting threads
 tools.continuations ;
index 935c1ee868436b31a8ebcd4f6a7baa01cfc58cff..63459b054d12f3a25338332857b6192cb1d7c294 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors calendar calendar.format io io.encodings.ascii
-io.servers.connection kernel threads ;
+io.servers kernel threads ;
 IN: time-server
 
 : handle-time-client ( -- )
index 24fadef5bf8bc157120cf91e534aa6ca5fb9053c..438faa0decf4f64ce5601457a869138e91e2c1b3 100644 (file)
@@ -1,5 +1,4 @@
-USING: listener io.servers.connection io.encodings.utf8
-accessors kernel ;
+USING: listener io.servers io.encodings.utf8 accessors kernel ;
 IN: tty-server
 
 : <tty-server> ( port -- )
index 05fabfcf9dd3d19bb5ce024970d446e7c419785a..a3545443995f0dd37f1a3a4bc0523a009e735228 100644 (file)
@@ -8,7 +8,7 @@ furnace.auth.features.registration furnace.auth.login
 furnace.boilerplate furnace.redirection html.forms http.server
 http.server.dispatchers kernel namespaces site-watcher site-watcher.db
 site-watcher.private urls validators io.sockets.secure.unix.debug
-io.servers.connection io.files.temp db db.tuples sequences
+io.servers io.files.temp db db.tuples sequences
 webapps.site-watcher.common webapps.site-watcher.watching
 webapps.site-watcher.spidering ;
 QUALIFIED: assocs
index e5753f3c538f9d86899ac10d046e835b57c88bf8..01ed2402f749b887c9fefd566c85b9ee4c83eb79 100644 (file)
@@ -122,7 +122,7 @@ furnace.auth.features.edit-profile
 furnace.auth.features.deactivate-user
 db.sqlite
 furnace.alloy
-io.servers.connection
+io.servers
 io.sockets.secure ;
 
 : <login-config> ( responder -- responder' )
index 35e4150ba9cd7af5a3a5eaf7f53dcc3629306ef3..61b4f7d8876a6dd06ace13161a3432ed7058a3cd 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (c) 2008, 2010 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel sequences assocs io.files io.pathnames
-io.sockets io.sockets.secure io.servers.connection
+io.sockets io.sockets.secure io.servers
 namespaces db db.tuples db.sqlite smtp urls
 logging.insomniac
 html.templates.chloe