Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I get the GET from gets in an open socket?

2 views
Skip to first unread message

Rick

unread,
Feb 20, 2002, 8:30:40 AM2/20/02
to
Hello,

I have a Flash movie using xmlSocket to connect to a Ruby server.

Flash passes in <user>testUser</user>.
Ruby returns <userlist>myList</userlist>.

So far I am unable to parse session.gets (the only place I am able to
find <user>testUser</user>) until session.close is called, but
session.close isn't being called until the user closes their flash
movie, hence the problem.

How do I parse session.gets without session.close? Is there a
different approach all together?

Thank you in advance.

Rick

ruby 1.6.5 (2001-09-19) [i386-cygwin]
Win2K server

require 'socket'
server = TCPServer.new('127.0.0.1',5190)
while (session = server.accept)
begin
thisUser = session.gets
thisUser = thisUser.scan(/<user>(.*?)<\/user>/).to_s

session.print "<userlist>#{thisUser}</userlist>\0"

ensure
session.close if session
#puts "sesson closed"
end
end

0 new messages