Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.ruby Subject: Re: Ruby Socket Programming: No connection could be made error Date: Sat, 28 Apr 2012 12:53:30 +0200 Lines: 25 Message-ID: References: <20233599.660.1335609938128.JavaMail.geo-discussion-forums@vbq19> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 41xW1+JY7rvU2EyHdRdcgAtZQUaC/7ePCyEuaSvJxI2yppXXM= Cancel-Lock: sha1:s3OlFDD3rtNfE+0ucgADmQAtmjY= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20120420 Thunderbird/12.0 In-Reply-To: <20233599.660.1335609938128.JavaMail.geo-discussion-forums@vbq19> Xref: csiph.com comp.lang.ruby:6524 On 28.04.2012 12:45, Merhawi Fissehaye wrote: > I am a beginner and I wanted to see how network programs are written in Ruby and I tried a sample Ruby code I found on the internet. There are two programs server.rb running in the background and client.rb trying to connect to my server program at the port number specific to the server program. > I found the following error when running client.rb : > > client.rb:6:in 'initialize' : No connection could be made because the target machine actively refused it. - connect(2) (Errno::ECONNREFUSED) > from client.rb:6:in 'open' > from client.rb:6:in '
' Could be any number of reasons from that you have misconfigured ports or the server is listening on 127.0.0.1 only which cannot be connected from a different machine or firewall blocking access... Can you give more details, show the code? > I am running the program from DOS Are you serious about that? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/