UDP bind to port in windows 8

(using Ruby 1.8.7)

Sometimes I have trouble with Ruby binding to a port on my windows 8
machine. The two lines of code in my program relevant here are:

my_socket = UDPSocket.new
my_socket.bind(“192.168.75.1”,64001)

After a fresh boot, my program will always work. If my computer has
been on a couple of days, it might sometimes fail with a “permission
denied” at the bind statement line #. I even try running the ruby
program from a prompt with administrative privileges but same error.

I’ve been googling this like crazy and one common thought is to check if
some program has already claimed that port. There’s a netstat command
that will show you all ports in use and nothing close to 64001 is ever
listed.

I used to run this program on windows 7 and never had an issue.
Something about Windows 8 is throwing a fault. Any help appreciated.

Thanks!

Hello,

A)You should try with
ruby 2.1
netcat/python/perl/tclsh/vb…

B) Firewall used to do think like that : bloc port without in ip/tcp
layer.
verify your events logs

C) did you schedule some task every night?

D) is this port the only one blocked ?

Regis d’Aubarede wrote in post #1145188:

Hello,

A)You should try with
ruby 2.1
python/perl/tclsh/vb…

B) Firewall used to do think like that : bloc port without in ip/tcp
layer.
verify your events logs

C) did you schedule some task every night?

D) is this port the only one blocked ?

Crap. All good questions/suggestions… Let me address them:

A) This is for some Ruby stuff I wrote a long time ago. Sure would be
nice not to have to update it. Especially for a simple bind issue.

B) Software (Windows) firewall is turned completely off.

C) No scheduling here.

D) When I am getting the error, it is only with port 64001. If I change
the code to 64002 the bind is successful.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs