Ruby on Win32: strange socket problems

D

Dido Sevilla

I've written a fairly large Ruby program that is, among other things,
a Jabber client, and as far as I've been able to test it, it works
reliably under GNU/Linux. It also appears to work reliably under
Windows with no changes, using the Windows XP SP2 install that we are
using for test. However, it doesn't seem to work on some other
installations of Windows XP that the client for whom the program was
written has available. When the program connects to the Jabber server
that we've set up, we performed a dump of the packets being exchanged
between the client and server and noted that it is trying to connect,
but eventually the exchange stops and the Ruby program freezes in the
middle of the TCP connection establishment phase after sending a final
ACK. Oddly enough, our local Windows test box doesn't suffer from this
problem, and certain client machines also do not suffer from this
problem. It seems that Ruby is unable to use network sockets at all on
these machines, as a simple TCP client stub program connecting to a
netcat instance exhibits the same behavior on these machines. We
cannot determine what, if anything, is different about the
configurations of the non-working Windows boxes that causes them to
behave as they do.

What could be going on here? All of these Windows boxes are either XP
SP1 or SP2 (with both types represented in functioning and
non-functioning machines), and are using the one-click Ruby installer
version 1.8.2-15. Has anyone else observed this mystifying behavior?
Any hints on what could be causing it and how to fix it?
 
P

Paul Hanchett

I have found it's relatively easy to run out of available sockets on XP
(even pro!) Netstat should show you a bunch of closed but unavailable
sockets if this is the problem.
 
M

Michael Weller

Dido said:
I've written a fairly large Ruby program that is, among other things,
a Jabber client, and as far as I've been able to test it, it works
reliably under GNU/Linux. It also appears to work reliably under
Windows with no changes, using the Windows XP SP2 install that we are
using for test. However, it doesn't seem to work on some other
installations of Windows XP that the client for whom the program was
written has available. When the program connects to the Jabber server
that we've set up, we performed a dump of the packets being exchanged
between the client and server and noted that it is trying to connect,
but eventually the exchange stops and the Ruby program freezes in the
middle of the TCP connection establishment phase after sending a final
ACK. Oddly enough, our local Windows test box doesn't suffer from this
problem, and certain client machines also do not suffer from this
problem. It seems that Ruby is unable to use network sockets at all on
these machines, as a simple TCP client stub program connecting to a
netcat instance exhibits the same behavior on these machines. We
cannot determine what, if anything, is different about the
configurations of the non-working Windows boxes that causes them to
behave as they do.

What could be going on here? All of these Windows boxes are either XP
SP1 or SP2 (with both types represented in functioning and
non-functioning machines), and are using the one-click Ruby installer
version 1.8.2-15. Has anyone else observed this mystifying behavior?
Any hints on what could be causing it and how to fix it?

Maybe they're running ZoneAlarm Firewall? I once had the problem that
ruby couldn't connect to any network while ZoneAlarm was installed (it
even blocked ruby when shutdown!) though ruby was "thrusted process"..

hth!

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top