use initital-quot: in threaded-server tuple declaration

db4
Doug Coleman 2009-06-11 20:20:38 -05:00
parent 4bd06486fb
commit 6c2e483913
1 changed files with 8 additions and 15 deletions
basis/io/servers/connection

View File

@ -11,17 +11,17 @@ combinators.short-circuit ;
IN: io.servers.connection
TUPLE: threaded-server
name
log-level
{ name initial: "server" }
{ log-level initial: DEBUG }
secure insecure
secure-config
sockets
{ secure-config initial-quot: [ <secure-config> ] }
{ sockets initial-quot: [ V{ } clone ] }
max-connections
semaphore
timeout
{ timeout initial-quot: [ 1 minutes ] }
encoding
handler
ready ;
{ handler initial: [ "No handler quotation" throw ] }
{ ready initial-quot: [ <flag> ] } ;
: local-server ( port -- addrspec ) "localhost" swap <inet> ;
@ -29,14 +29,7 @@ ready ;
: new-threaded-server ( encoding class -- threaded-server )
new
swap >>encoding
"server" >>name
DEBUG >>log-level
1 minutes >>timeout
V{ } clone >>sockets
<secure-config> >>secure-config
[ "No handler quotation" throw ] >>handler
<flag> >>ready ; inline
swap >>encoding ;
: <threaded-server> ( encoding -- threaded-server )
threaded-server new-threaded-server ;