[libxml-devel] [ libxml-Bugs-22531 ] XML::Reader does not work with sockets

noreply at rubyforge.org noreply at rubyforge.org
Sat Nov 15 18:45:03 EST 2008


Bugs item #22531, was opened at 2008-10-23 07:06
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22531&group_id=494

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Han Holl (hanholl)
Assigned to: Nobody (None)
Summary: XML::Reader does not work with sockets

Initial Comment:
I tried with the two following programs:
A server:
#!/usr/bin/ruby -w

require 'rubygems'
require 'xml'
require 'socket'


server = TCPServer.new(22222)
while session = server.accept
  reader = XML::Reader.io(session)
  loop do
    rsl = reader.read
    puts rsl
    break if rsl != 1
    puts reader.expand
  end
  session.puts 'ok'
  sleep 1
  session.close
end
# end-of-server
and a client:
#!/usr/bin/ruby

require 'socket'

t = TCPSocket.new('localhost', 22222)

t.puts '<doc><a>k</a></doc>'
puts t.gets
# end-of-client

Output from server:
Entity: line 1:
parser
error :
Extra content at the end of the document

^
-1

I tried different platforms (RH9, CentOS 5.1 and Fedora8).
libxml-ruby-0.8.3
Various libxml2 versions

----------------------------------------------------------------------

>Comment By: Charlie Savage (cfis)
Date: 2008-11-15 16:45

Message:
Yes, that is not going to work.  Libxml does provide its own socket implementation, but that is not exposed via the ruby bindings.  Want to put together a patch?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22531&group_id=494


More information about the libxml-devel mailing list