Hi .. 

"Bill Kelly" <billk / cts.com> wrote:
> 
> From: "Mark Probert" <probertm / nospam-acm.org>
>>
>> I was wondering if anyone has advice on how to debug the following 
>> problem.  I am using Ruby 1.8.1, establishing telnet sessions whilst
>> in a thread.  Most of the time, it is fine.  Every now and then, the 
>> socket.syswrite() in telnet seems to send characters bound for
>> another socket / thread.  Or so it seems.  
> 
> Sorry I can't be of more help....  Only #send and #recv...
> 
Thanks, Bill.  

the @sock.syswrite() is the base call in all of Telnet, underlying the
print(), puts(), cmd() and so on.  It is the primative that is called to
send data to the host. 

As an update, I managed to get the system to 'fail' with dump-log turned
on.  the dump log records that the command is corrupted prior to it
being sent.  The code flow looks like: 

  puts "sending cmd -- #{c}"  # c is correct here
  @conn.write(c)   # @conn is a Telnet object --> calls Telnet.write()

    def write(string)
      length = string.length
      while 0 < length
        IO::select(nil, [@sock])
        @dumplog.log_dump('>', string[-length..-1]) if @options.has_key?
        "Dump_log")  # <---  string is bad here! length -=
        @sock.syswrite(string[-length..-1]) 
      end
    end

so, i can only assume that one of the other threads is writing to the
this string.  Is this possible?  Or is there some other way that the
passed string can become corrupt? 

Perplexed ...

-mark.