Re: Getting working code to work with socket communications
- From: mhnpittsburgh@xxxxxxxxx
- Date: Tue, 21 Aug 2007 09:30:25 -0700
In the example below, the goal is to have
puts "x is $x"
executed UNTIL 'telnet the_host 9900' is done.
Instead, the puts statement is not execute UNLESS
'telnet the_host 9900' is done.
# ---------------------paste example
# Run this in one window, say, on the_host,
# In another window,
#
# The result will show
# Connection from the_host registered
# every time 'telnet the_host 9900' is done.
#
global do_the_action
set do_the_action 0
proc Server {channel clientaddr clientport} {
global do_the_action
puts "Connection from $clientaddr registered"
puts "10: do_the_action is $do_the_action"
close $channel
set do_the_action 1
}
socket -server Server 9900
vwait do_the_action
puts "20: do_the_action is $do_the_action"
# Unfortnately, the code execution never gets past here. This
# simulates the real, working section of the code, and is in reality
# well over a hundred thousand lines long.
for {set x 0} {$x<10} {incr x} {
puts "x is $x"
after 1000
if { $do_the_action } { break; }
}
#--------------------- end paste example
.
- Follow-Ups:
- Re: Getting working code to work with socket communications
- From: slebetman@xxxxxxxxx
- Re: Getting working code to work with socket communications
- References:
- Getting working code to work with socket communications
- From: mhnpittsburgh
- Re: Getting working code to work with socket communications
- From: John Seal
- Re: Getting working code to work with socket communications
- From: mhnpittsburgh
- Getting working code to work with socket communications
- Prev by Date: Re: Getting working code to work with socket communications
- Next by Date: Re: Web Service -- how to access with TCL
- Previous by thread: Re: Getting working code to work with socket communications
- Next by thread: Re: Getting working code to work with socket communications
- Index(es):
Relevant Pages
|
|