On 3/20/12 5:26 AM, David Bariod wrote:
> On Mar 20, 9:44 am, Tobias Vesterlund<vak...@gmail.com> wrote:
>> Hi,
>>
>> I have a peace of code which works as wanted on windows, but when I
>> try it on linux it stops working.
>>
>> set s [socket host.com 8200]
>>
>> fconfigure $s -buffering none -blocking 0 -translation auto
>> proc reportVersion {chan} {
>> puts "triggered"
>> if {[gets $chan line]< 0} {
>> if {[eof $chan]} {
>> close $chan
>> return
>> }
>> } else {
>> puts $line
>> }}
>>
>> fileevent $s readable[list reportVersion $s]
>> puts -nonewline $s "command"
>> after 2000
>> gets $s
>>
>> on windows the reply is caught by the fileevent, but on linux is the
>> gets $s gets the message.
>>
>> How do I get fileevent to catch the reply in linux?
>
> Hello,
>
> I don't know why it works on Windows,
Most likely he is testing interactively from a "wish console" -- which is
implemented in Tcl and has an event loop active to receive the new command
typed in.
--
+------------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email:
Gerald.Lester@kng-consulting.net |
+------------------------------------------------------------------------+