TclHttpd: Working example of multi-threaded operation?
- From: Andreas Brand <abr@xxxxxxxx>
- Date: Thu, 11 Aug 2005 10:11:14 +0200
Hello,
does anyone use the multi-threaded feature of the TclHttpd server and got the server running?
How do I install an URL handler to be run as a worker thread correctly? Have I understood it correctly that the URL handler must respond with Thread_Respond like in the following example?
<----------------------------------------
Url_PrefixInstall $prefix [list InternalThreadedDomainHandler $prefix] -thread 1
proc getTimedPage {} {
set html "<html><title>Timed Page</title><body>\n"
append html "Time: [clock format [clock seconds]]"
append html "</body>\n"
return $html
}proc InternalThreadedDomainHandler {prefix sock suffix} {
upvar #0 Httpd$sock data
set html [getTimedPage]
Thread_Respond $sock [list Httpd_ReturnData $sock text/html $html]
}
---------------------------------------->Working code highly appreciated!
Greetings, -Andreas. .
- Follow-Ups:
- Prev by Date: Re: Oratcl 4.3 crash with Oracle9i on windows
- Next by Date: Re: variable substitution
- Previous by thread: TclJava error on Windows
- Next by thread: Re: TclHttpd: Working example of multi-threaded operation?
- Index(es):
Relevant Pages
|