Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to use interp/bgerror

15 views
Skip to first unread message

jemptymethod

unread,
Sep 14, 2009, 8:21:24 AM9/14/09
to
I'm trying to run tclhttpd in a slave interpreter (http://www2.tcl.tk/
8755) but slightly modified so as to run within a tclkit. The code
below "runs" (I can hit http://localhost:8015) but never reaches the
puts line at the bottom because "the server does not return, it enters
[vwait forever]". But when I try "the after 0 trick", e.g. prepending
"after 0 " to the line "$httpd eval $cmd", the server does not run at
all, so I presume "errors have to be handled by bgerror"

However I cannot find good examples of how to use bgerror, plus my
research shows that now the convention is to use "interp bgerror".
Please see the first couple of examples returned by
http://www2.tcl.tk/_/gsearch?S=bgerror; the first link contains the
verbiage "fill in useful tricks and examples for using bgerror" but
then there are no samples I can discern how to apply, and the second
link concludes "I am interested in examples how this is supposed to be
used."

PS....same question posted on stackoverflow for those who want to
garner a little rep over there: http://stackoverflow.com/users/34806/george-jempty

package require starkit
starkit::startup

set httpd_args [list]
set httpd [interp create]
$httpd eval "set argc [llength $httpd_args]"
set cmdargv "set argv [list $httpd_args ]"
$httpd eval "set topdir $starkit::topdir"
$httpd eval $cmdargv

set cmd [list source [file join $starkit::topdir bin/httpd.tcl]]
$httpd eval $cmd

puts "if seeing this controlled has returned"

0 new messages