Sorry, I can'help. IIRC Damon was able to get data through a socket channel. My 
only hint is to set up your own Tcl written echo server. B.Welch's "Practical 
Programmin ..." had one very simple. I don'have the companion CD  with me but 
probably others on this list have it. Just to see if other fconfigure 
parameters would change anything.

 -- Massimo 
Inviato dal mio BlackBerry®

-----Original Message-----
From: Brice Hamon <normandvik...@gmail.com>
Date: Sat, 17 Aug 2013 12:12:45 
To: Massimo Manghi<mxman...@apache.org>
Subject: Re: Re: Socket gets hanging in Rivet

Oh, I see.

I thought this problem was only in multi-threaded TCL and with fileevent
command.

But in my case I don't think my TCL is MT (How can I see that BTW?), and
also I don't use fileevent.

I don't think the line termination has anything to do with that as it works
outside rivet.

Am I missing something?

Thank you Massimo.

Brice.



On Sat, Aug 17, 2013 at 12:07 PM, Massimo Manghi <mxman...@apache.org>wrote:

> **
> So it seems a line termination is needed. Did I get it?
>
> My other concern is about how under the hood Tcl 8.5 is doing synch I/O.
> Is it doing it for real or just behaving like it was synchronous? By chance
> is it actually doing asynch I/O but waiting forever for the event loop to
> return data? They never get returned when in rivet for the reason we have
> long discussed weeks ago and for which a fix will hopefully be in 8.5.15
> and 8.6.1
>
>
> -- Massimo
> Inviato dal mio BlackBerry®
> ------------------------------
> *From: * Brice Hamon <normandvik...@gmail.com>
> *Date: *Sat, 17 Aug 2013 11:18:46 -0400
> *To: *Massimo Manghi<mxman...@apache.org>
> *Cc: *rivet-dev@tcl.apache.org<rivet-dev@tcl.apache.org>
> *Subject: *Re: Socket gets hanging in Rivet
>
> Hi Massimo,
>
> I used this echo server:
> http://www.cab.u-szeged.hu/local/doc/tcl/SocketExample.html
>
> It just does a puts $s $data
> on a file descriptor with
>
> fconfigure $sock -buffering line -blocking 0
>
> Thank you.
>
> B.
>
>
>
>
> On Sat, Aug 17, 2013 at 11:14 AM, Massimo Manghi <mxman...@apache.org>wrote:
>
>> **
>> Is you echo server returning the data without buffering or line
>> termination? IIRC good old echo available on port 6 (?) required a newline,
>> isn't it?
>>
>> -- Massimo
>> Inviato dal mio BlackBerry®
>> ------------------------------
>> *From: * Brice Hamon <normandvik...@gmail.com>
>> *Date: *Sat, 17 Aug 2013 10:31:17 -0400
>> *To: *rivet-dev@tcl.apache.org<rivet-dev@tcl.apache.org>
>> *Subject: *Socket gets hanging in Rivet
>>
>> Hi all,
>>
>> I am facing a unexpected problem with such simple code in Rivet:
>> I open a socket to an echo server, send something and wait for the answer.
>>
>> I open the socket like that:
>>
>> set port 20445
>> set host "toto2"
>> set s 0
>>
>> proc connectToBs {} {
>>     ::request::global s
>>     ::request::global port
>>     ::request::global host
>>
>>     set s [socket $host $port]
>>     puts "Connected to $host:$port"
>>     fconfigure $s -buffering none
>>     fconfigure $s -translation binary
>> }
>>
>> Then:
>>
>> connectToBs
>> puts -nonewline $s "OKOK"
>> set resp {}
>> gets $s resp         <=== and I am getting stuck in the gets forever.
>>
>> The same code under a regular tclsh works. I don't get it.
>>
>> I am using the native TCL8.5.10 from SUSE 12.1 with Rivet 2.1.2.
>>
>> Any idea?
>>
>> Thanks,
>> Brice.
>>
>
>

Reply via email to