From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2001-09-03T17:12:06+09:00 Subject: [ruby-talk:20748] dRuby,TCPSocket and blocked ports (Linux question) This may be more of a Linux question, but maybe someone else here has experienced this and has found a way around it... I was initially playing with the dRuby examples on page 275 of the Pickaxe book. I was using two Linux machines here on my home network - one to run the server the other to run the client. But I kept getting connection refused errors on the client machine ... I knew that I had tried this exact code months ago at work (on Windows machines). Then I tried running the server on a windows machine on my network and ran the client on the Linux machine - it worked, no problem. then I concluded that my Linux boxen are blocking port 9000 (the port address used in the examples), so to figure out which ports were available I wrote this script: #######socket_test.rb########## require 'socket' machine = "127.0.0.1" (0..20000).each { |port| begin puts "trying: #{port}" if $DEBUG soc = TCPSocket.open(machine, port) puts "***SUCCESS: port #{port}" rescue puts "couldn't open port: #{port}" if $DEBUG ensure soc.close if soc end } ######end#################### I ran it on each Linux box and got the following results: ***SUCCESS: port 9 ***SUCCESS: port 13 ***SUCCESS: port 21 ***SUCCESS: port 22 ***SUCCESS: port 37 ***SUCCESS: port 80 ***SUCCESS: port 111 ***SUCCESS: port 515 ***SUCCESS: port 6000 ***SUCCESS: port 16001 [Side note: Interestingly enough, I also ran this script on Windows98 and it doesn't seem to do anything - gets stuck right away at port 1 - since all ports seem to be available on Windows, I'm not sure why that is (?)] Not a lot of available (non-blocked) ports... and these are of course being used by other services (checked /etc/services ). This all makes sense from a security standpoint (at least for the firewall) - but it makes it hard to use dRuby. So, does anyone know how to unblock a port, say port 9000, so I can use it for dRuby? Phil