[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

socket not connected

Mateusz Winiarski

6/21/2008 12:14:00 PM

Hi,

I want to run simple code:

require 'net/http'
Net::HTTP.start('www.rubyinside.com') do |http|
req = Net::HTTP::Get.new('/test.txt')
puts http.request(req).body
end

but I've got following error:

A request to send or receive data was disallawed because the socket is
not connected and (when sending on a datagram socket using a sendto
call) no address was supplied. (Errno::ENOTCONN).

Is it because im behind proxy ?

How to make code run smoothly ?

Thx
--
Posted via http://www.ruby-....

1 Answer

Zhukov Pavel

6/21/2008 12:20:00 PM

0

On Sat, Jun 21, 2008 at 4:14 PM, Mateusz Winiarski
<mawiniarski@gmail.com> wrote:
> Hi,
>
> I want to run simple code:
>
> require 'net/http'
> Net::HTTP.start('www.rubyinside.com') do |http|
> req = Net::HTTP::Get.new('/test.txt')
> puts http.request(req).body
> end
>
> but I've got following error:
>
> A request to send or receive data was disallawed because the socket is
> not connected and (when sending on a datagram socket using a sendto
> call) no address was supplied. (Errno::ENOTCONN).
>
> Is it because im behind proxy ?


Yes

> How to make code run smoothly ?

Look at Net::HTTP::Proxy


> Thx
> --
> Posted via http://www.ruby-....
>
>