Handbook
Glossary
handle-client* ( threaded-server -- )
Threaded servers
Prev:
new-threaded-server ( encoding class -- threaded-server )
Next:
Threaded server configuration
Vocabulary
io
.
servers
Inputs
threaded-server
a
threaded-server
Outputs
None
Generic word contract
Handles a client connection. Default implementation calls quotation stored in the
handler
slot of the threaded server.
Definition
IN:
io.servers
GENERIC:
handle-client*
( threaded-server -- )
Methods
USING:
destructors
ftp.server
io.servers
kernel
logging
namespaces
;
M:
ftp-server
handle-client*
[
"New client"
\
handle-client*
DEBUG
log-message
ftp-client
new
client
set
[
server
set
]
[
serve-directory
]
bi
]
with-destructors
;
USING:
accessors
combinators
gemini.server
gemini.server.private
io
io.files.info
io.files.types
io.servers
kernel
sequences
;
M:
gemini-server
handle-client*
dup
serving-directory>>
read-gemini-path
append
dup
file-info
[
send-status
]
2keep
type>>
{
{
+directory+
[
send-directory
]
}
{
+regular-file+
[
nip
send-file
]
}
[
3drop
]
}
case
flush
;
USING:
accessors
combinators
gopher.server
gopher.server.private
io
io.files.info
io.files.types
io.pathnames
io.servers
kernel
;
M:
gopher-server
handle-client*
dup
serving-directory>>
read-gopher-path
append-path
dup
file-info
type>>
{
{
+directory+
[
send-directory
]
}
{
+regular-file+
[
nip
send-file
]
}
[
3drop
]
}
case
flush
;
USING:
continuations
destructors
http.server
http.server.requests
io.servers
io.streams.limited
kernel
namespaces
;
M:
http-server
handle-client*
drop
[
[
?refresh-all
request-limit
get
limited-input
[
read-request
]
?benchmark
[
do-request
]
?benchmark
[
do-response
]
?benchmark
]
[
handle-client-error
]
recover
]
with-destructors
;
USING:
accessors
continuations
generic
http
http.server
http.server.requests
http2.server
io.servers
io.sockets
io.streams.limited
kernel
namespaces
;
M:
http2-server
handle-client*
?refresh-all
request-limit
get
limited-input
secure-addr
dup
port>>
local-address
get
port>>
=
and
[
t
[
f
start-http2-connection
]
[
M\
http2-server
handle-client*
(call-next-method)
]
if
]
[
f
[
f
start-http2-connection
]
[
[
[
read-request
]
?benchmark
dup
"Upgrade"
header
"h2c"
=
[
start-http2-connection
]
[
nip
[
do-request
]
?benchmark
[
do-response
]
?benchmark
]
if
]
[
nip
handle-client-error
]
recover
]
if
]
if
;
USING:
continuations
io.servers
managed-server
managed-server.private
namespaces
;
M:
managed-server
handle-client*
managed-server
set
[
handle-managed-client
]
[
cleanup-client
]
finally
;
USING:
accessors
benchmark.tcp-echo0
io.servers
kernel
math
;
M:
tcp-echo
handle-client*
[
#times>>
]
[
#bytes>>
]
bi
[
test-bytes
write-read
]
curry
[
times
]
2curry
call
;
USING:
accessors
combinators
io.servers
;
M:
threaded-server
handle-client*
handler>>
( -- )
call-effect
;