Just a quick thought, your write call is writing 4 bytes
"write(fd,"OK\n",4);"
This means you are sending O, K, newline, and a NULL character.
I would try just sending 3 bytes to see if that fixes the problem.
eric
At 10:47 AM 10/09/00 +0100, you wrote:
>I have written some code with vtcl that runs fine when I run it from with
wish
>but fails in "test" mode within vtcl.
>
>The code opens a network socket to a C application which reads input and
>replies with either "OK" or "FAIL".
>
>The tcl code looks like this
>
>-------------------------------------------------------------
>proc {updateF1} {} {
>global widget but19 but20 but21 but22 but23 but25 comms
>
>set F1 [expr $but19 + $but20 + $but21 + $but22 + $but23 + $but25]
>puts "F1 = $F1"
>
>
>puts -nonewline $comms "WG F1 $F1 "
>flush $comms
>
>set n [gets $comms reply]
>puts "reply=$reply n=$n"
>}
>---------------------------------------------------------------
>
>The C code uses "write(fd,"OK\n",4);" to send the reply.
>
>The first time this is called I get the expected output
>
>"reply=OK n=3"
>
>Following calls produce just
>
>"reply="
>
>If I run the code from wish I get the correct output every time.
>
>Any ideas ?
>
>Peter Onion
>
>----------------------------------
>E-Mail: Peter Onion <[EMAIL PROTECTED]>
>Date: 09-Oct-00
>Time: 10:38:21
>
>This message was sent by XFMail
>----------------------------------
>_______________________________________________
>vtcl-user mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/mailman/listinfo/vtcl-user
>
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/vtcl-user