Re: Server help
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Server help

From: SM Ryan <wyrmwif@tango-sierra-oscar-foxtrot-tango.fake.org>
Date: Wed Jun 29 2005 - 04:28:05 CEST

"Ray" <ray.mosley@gmail.com> wrote:
# I am using Tcl 8.3. I copied the code from
# http://www.tcl.tk/scripting/netserver.html, and saved it as
# serverLib.tcl.
#
# I start two tclsh session; in one tclsh (W1) I enter
# source serverLib.tcl
# set s [socket -server EchoAccept 2540]
# and the socket is operned
#
# In the other tclsh window (W2) I enter
# source serverLib.tcl
# set s [Echo_Client localhost 2540]
# the socket is opened
#
# Still following the example, in W2 I enter
# puts $s "Hello"
# gets $s line
# Here is hangs - no response until I go to W1 and
# enter

Are you flushing the output?
        puts $s Hello
        flush $s
or
        fconfigure $s -buffering line
        ...
        puts $s Hello

# close $s

close flushes output.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
She broke your heart and inadvertently drove men to deviant lifestyles.
Received on Thu Sep 29 14:23:30 2005