[Activetcl] tcl service - terminates
by schoepe other posts by this author
Jul 18 2008 3:22AM messages near this date
view in the new Beta List Site
[Activetcl] known issue with ActiveTcl installer on Mac OS X 10.5.3 + 2008-005 security update
|
Re: [Activetcl] tcl service - terminates
Hello,
I have a problem running a windows service.
Windows starts the service and terminates its immediately.
The service is an IPC for mutex and shared memory.
It must run continuous to remember the data.
What should changed, that the service will not terminate?
Regards,
Alex
P.S.: Platform: Windows XP Pro SP3 running ActiveTcl 8.4.19 and DevKit 4.1.0
--- snipp --- partial source code ---
namespace eval ::NetUtil::Server {
namespace export Daemon
variable options
variable client
variable socket
set options(count) 0
set options(port) 30815
set options(server) localhost
}
proc NetUtil::Server::Read { fd } {
variable client
if {[eof $fd]} {
Close $fd
} else {
set n [gets $fd line]
if {$n == -1} {
Close $fd
} else {
switch -glob -- $line {
mutex* {
# ...
}
shared* {
# ...
}
}
}
}
}
proc NetUtil::Server::Close { fd } {
variable options
variable client
variable socket
incr options(count) -1
catch { close $fd }
# ...
array unset client $fd
array unset socket $fd
}
proc NetUtil::Server::Connect { fd addr port } {
variable options
variable client
variable socket
set socket($fd) [list $addr $port]
set client($fd) {}
incr options(count)
fconfigure $fd -buffering line
fileevent $fd readable "NetUtil::Server::Read $fd"
}
proc NetUtil::Server::Daemon {} {
variable options
if {[catch {socket -server NetUtil::Server::Connect $options(port)} fd] == 0} {
if {![info exists ::tcl_service] && ![info exists ::tk_version]} {
vwait forever
}
}
}
NetUtil::Server::Daemon
_______________________________________________
ActiveTcl mailing list
ActiveTcl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
schoepe
Jeff Hobbs
|