App fails on Windows, but works on OS X

I’ve been working on a query app for Battlefield 2142 servers, and the
following app always fails on some IPs in Windows:

http://pastie.org/537069.txt

The IPs it works on, it will always work on; the IPs it fails on, it
will always fail on. I’ve left two sample IPs in the application. The IP
that does not work on Windows has not ever worked, but I tried it on OS
X and it worked flawlessly there despite both the mac and the windows
machines being on the same network. I’ve tried it on three separate
Windows machines (two on the same network, one in a data centre) with
Windows Vista Ultimate 64 bit, Windows Vista 32 bit, Windows Server 2003
32 bit. It failed on all three of those Windows systems.

Both the mac and the Windows machine are running Ruby 1.8.6. Anyone able
to help me understand what might account for the problems in Windows?

Thanks for any assistance!

Randy G. wrote:

I’ve been working on a query app for Battlefield 2142 servers, and the
following app always fails on some IPs in Windows:

Sounds suspiciously like a networking issue – firewall, port conflict,
something of that nature where the machines that fail, have different
settings or environment. Maybe the internal software firewall of those
machines?

– gw

I wonder if it’s possible that there is a permissions issue where
scripts don’t have sufficient permissions. I think windows makes a
distinction between scripts and executables, and ruby is a script
language.

I wonder what happens if you run a tool to convert the ruby app to an
exe if it would still fail or maybe fail with some error message that
might give a better clue about what is wrong

PS: I top post so folks don’t have to scroll through all the already
read stuff, to see the reply.


From: Randy G. [email protected]
To: ruby-talk ML [email protected]
Sent: Tuesday, July 7, 2009 10:54:41 AM
Subject: Re: App fails on Windows, but works on OS X.

Greg W. wrote:

Randy G. wrote:

I’ve been working on a query app for Battlefield 2142 servers, and the
following app always fails on some IPs in Windows:

Sounds suspiciously like a networking issue – firewall, port conflict,
something of that nature where the machines that fail, have different
settings or environment. Maybe the internal software firewall of those
machines?

– gw

Hi Greg,
Thanks for responding.

The systems I tried were all on separate networks, two of them were on
residential ISP networks (but different networks) and the last one was
in a data centre. I don’t believe there’s any software firewalls on the
machines that would block it, and the mac that was able to connect was
behind the same network as one of those Windows machines that could not
connect.

To add something even more peculiar, I have another app that sends out
the exact same packets to 2142 servers (a windows based app coded in
C++) and it has no problem receiving a response.

I gave that a shot after compiling the script using OCRA. Unfortunately
it behaved he exact same way.

Greg W. wrote:

Randy G. wrote:

I’ve been working on a query app for Battlefield 2142 servers, and the
following app always fails on some IPs in Windows:

Sounds suspiciously like a networking issue – firewall, port conflict,
something of that nature where the machines that fail, have different
settings or environment. Maybe the internal software firewall of those
machines?

– gw

Hi Greg,
Thanks for responding.

The systems I tried were all on separate networks, two of them were on
residential ISP networks (but different networks) and the last one was
in a data centre. I don’t believe there’s any software firewalls on the
machines that would block it, and the mac that was able to connect was
behind the same network as one of those Windows machines that could not
connect.

To add something even more peculiar, I have another app that sends out
the exact same packets to 2142 servers (a windows based app coded in
C++) and it has no problem receiving a response.

Thank you so much, Roger! Setting Basic_Socket.do_not_reverse_lookup to
true fixed the issue.

Can’t thank you enough, this problem was driving me absolutely mad!

Roger P. wrote:

Randy G. wrote:

I’ve been working on a query app for Battlefield 2142 servers, and the
following app always fails on some IPs in Windows:

http://pastie.org/537069.txt

I assume flipping the order doesn’t help? I would probably next make
sure ping works between the machines, if it does then try wire sharking
to see what is happening. Maybe
BasicSocket.do_not_reverse_lookup = true

http://rubydoc.ruby-forum.com/doc/ruby-1.9.1-p129/classes/BasicSocket.html#M002524

=r

Randy G. wrote:

I’ve been working on a query app for Battlefield 2142 servers, and the
following app always fails on some IPs in Windows:

http://pastie.org/537069.txt

I assume flipping the order doesn’t help? I would probably next make
sure ping works between the machines, if it does then try wire sharking
to see what is happening. Maybe
BasicSocket.do_not_reverse_lookup = true

http://rubydoc.ruby-forum.com/doc/ruby-1.9.1-p129/classes/BasicSocket.html#M002524

=r