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: Gerald W. Lester <Gerald.Lester@cox.net>
Date: Wed Jun 29 2005 - 03:42:03 CEST

Ray 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
> close $s
> or
> set forever 1
>
> I get the prompt back in W2 until I force a close or exit in W1.
>
> What am I doing wrong? The example seems so easy.
>
You either need to use wish or enter the event loop via vwait.

-- 
+--------------------------------+---------------------------------------+
| Gerald W. Lester               | "The man who fights for his ideals is |
| Gerald.Lester@cox.net          |  the man who is alive." -- Cervantes  |
+--------------------------------+---------------------------------------+
Received on Thu Sep 29 14:23:30 2005