I’m kindof new to ruby, and I’m trying to figure out some networking
stuff for ruby, but I keep getting “Errno::ECONNREFUSED”. I am on
Windows 7, and I’m just using the cmd prompt to run my code. I disabled
my firewall and run it, but that didn’t work. Any suggestions?
This is what happens when I run my code:
$- ruby serverexample.rb
initialize': No connection could be made because the targ et machine actively refused it. - connect(2) (Errno::ECONNREFUSED) from serverexample.rb:5:inopen’
from serverexample.rb:5:in `’
Here is a copy of serverexample.rb (which I got from
hostname = ‘localhost’
port = 2000
s = TCPSocket.open(hostname, port)
while line = s.gets
Thank you for the help.