[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Problem with sockets in Ruby 1.8.5

Dido Sevilla

10/5/2006 8:17:00 AM

I've just updated to Ruby 1.8.5 and tried using Webrick for a little
application. Funny thing was if I didn't specify a bind address,
Webrick crashed with a SocketError. I isolated the code that causes
this problem, and it turns out to be a Socket::getaddrinfo call:

$ ruby -ve 'require "socket"; Socket::getaddrinfo(nil, 12345,
Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)'
ruby 1.8.5 (2006-08-25) [i686-linux]
-e:1:in `getaddrinfo': getnameinfo: ai_family not supported (SocketError)
from -e:1

No such problems on Ruby 1.9 (2006-09-29) or Ruby 1.8.2 (2004-12-25)
or Ruby 1.8.4 (2005-12-24). I'm on Gentoo Linux. Apparently the bind
address must be set to some address (0.0.0.0 works just fine), but it
cannot be nil. Since it appears that lots of existing code using the
Socket library doesn't set an explicit bind address as required here,
it seems that updating to 1.8.5 might cause lots of breakage.

11 Answers

Yukihiro Matsumoto

10/6/2006 7:12:00 AM

0

Hi,

In message "Re: Problem with sockets in Ruby 1.8.5"
on Thu, 5 Oct 2006 17:17:18 +0900, "Dido Sevilla" <dido.sevilla@gmail.com> writes:

|this problem, and it turns out to be a Socket::getaddrinfo call:
|
|$ ruby -ve 'require "socket"; Socket::getaddrinfo(nil, 12345,
|Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)'
|ruby 1.8.5 (2006-08-25) [i686-linux]
|-e:1:in `getaddrinfo': getnameinfo: ai_family not supported (SocketError)
| from -e:1

My 1.8.5 does not raise any error on Debian sid. That might be caused
by configure options. Can you show us your configure options?

matz.

Dido Sevilla

10/6/2006 9:11:00 PM

0

On 10/6/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> My 1.8.5 does not raise any error on Debian sid. That might be caused
> by configure options. Can you show us your configure options?

Strange. Well, I'm just using the standard ebuild with threading and
cjk enabled, and so that translates to the following configure
options:

configure --program-suffix=18 --enable-shared --enable-pthread --with-sitedir=/usr/lib/ruby/site_ruby

Since I have the cjk use option enabled Gentoo also patches my Ruby
with Oniguruma. I built it using GCC 4.1.1 (gentoo-r1), and glibc
2.4:

GNU C Library development release version 2.4, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.1 (Gentoo 4.1.1-r1).
Compiled on a Linux 2.6.17 system on 2006-09-14.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
Support for some architectures added on, not maintained in glibc core.
BIND-8.2.3-T5B
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bug....

I'm running Ruby 1.9.0 on the same system built with the same compiler
and don't experience the same problem with it.

As a bit of an experiment I tried to build with gcc 3.4.6 (Gentoo-r1),
and it still fails to work.

RB

10/10/2012 11:37:00 AM

0


"Kangaroo Court Australia" <illusionz.admin@gmail.com> wrote in message
news:ec09606d-cc0d-4e44-9b4c-7384596ae0f5@lb2g2000pbc.googlegroups.com...
>
>> Two things follow:-
>>
>> If you want to make a fortune get into the industries that derive
>> profit from human loneliness - cam-whores or something like that.
>>
>> The existing super-rich are highly motivated to prevent a post-
>> scarcity economy from ever happening and will sabotage its development
>> at any chance.
>
> Craig Thomson knows how to generate jobs the right way then? LOL
>
> And if you cannot get it that way, u can always do the Slipper way !!
>


You cross posters are a bunch of mussel meat....


Graham Cooper

10/11/2012 12:01:00 AM

0

On Oct 11, 9:26 am, "Trevor" <tre...@home.net> wrote:
> "Wolfgang Wildeblood" <wolfgangwildebl...@gmail.com> wrote in message
>
> news:36bf4dcb-4c9d-41e1-8b7f-6772ef5632f8@kg10g2000pbc.googlegroups.com...
> Superhuman AI will improve itself at an exponentially increasing rate
> then revolutionize all industrial processes almost instantaneously,
> ushering in a post-scarcity economy. Everyone will be able to live in
> a mansion, drive a supercar feast like a king, travel anywhere on
> earth for free, and have as many iPhones as they want.
>
> The only "commodities" that will be in short supply will be love,
> companionship, and similar intangible, touchy-feely nonsense. That's
> where the next round of super-fortunes will be made. In fact, it's
> where the last round of fortunes will be made. In a post-scarcity
> economy profits made from physical goods and services will be
> negligible, and making fortunes from them impossible.
>
> Two things follow:-
>
> If you want to make a fortune get into the industries that derive
> profit from human loneliness - cam-whores or something like that.
>
> ----------------------------------------------------------------------
>
> What drugs have you been taking? The real shortages will be raw materials,
> land, food, water, breathable air etc for the 10-20+ Billion people on the
> planet by then.
> Where the hell are you going to put those "mansions" for all of them, not to
> mention roads for all of those "supercars".
>
> Trevor.

there might be some competition who gets the beachfront ones!

the Govt. infrastracture for new places to live doesn't have to be
that expensive.


1 Build the bitumen roads an extra 20 miles out of the towns and
cities.

2 Set up the fence lines.

3 Install a septic tank

4 Lot of Industrial bins every 10km

5 Ensure mobile towers cover the area.

****

that's pretty much all I have set up. apart from drought areas which
you shouldn't inhabit in the first place, (not until desalination
plants are setup anyway..)

The Power & Water can all be done in house. (on house!)

I had a shed, water tank, and septic tank installed, and setup hot
showers, flushable loo, kitchen, fridge, power, lights, etc. etc. all
with camping gear!

It's like Public Libraries, don't need them now! We only need the
services we can't do ourselves, roads, communications.

The water pipes, power lines, sewerage pipes, phone lines...

all the connections to every house in the city you don't need any of
them!

You should be able to get a $100,000 3 bed house 20 mins out of town!

Govt. doesn't want a new "lower class" paying a cheap mortgage having
free time!

Herc

Trevor

10/11/2012 12:27:00 AM

0


"Wolfgang Wildeblood" <wolfgangwildeblood@gmail.com> wrote in message
news:36bf4dcb-4c9d-41e1-8b7f-6772ef5632f8@kg10g2000pbc.googlegroups.com...
Superhuman AI will improve itself at an exponentially increasing rate
then revolutionize all industrial processes almost instantaneously,
ushering in a post-scarcity economy. Everyone will be able to live in
a mansion, drive a supercar feast like a king, travel anywhere on
earth for free, and have as many iPhones as they want.

The only "commodities" that will be in short supply will be love,
companionship, and similar intangible, touchy-feely nonsense. That's
where the next round of super-fortunes will be made. In fact, it's
where the last round of fortunes will be made. In a post-scarcity
economy profits made from physical goods and services will be
negligible, and making fortunes from them impossible.

Two things follow:-

If you want to make a fortune get into the industries that derive
profit from human loneliness - cam-whores or something like that.


----------------------------------------------------------------------

What drugs have you been taking? The real shortages will be raw materials,
land, food, water, breathable air etc for the 10-20+ Billion people on the
planet by then.
Where the hell are you going to put those "mansions" for all of them, not to
mention roads for all of those "supercars".

Trevor.




Wolfgang Wildeblood

10/11/2012 12:29:00 AM

0

On Oct 11, 7:26 am, "Trevor" <tre...@home.net> wrote:
> "Wolfgang Wildeblood" <wolfgangwildebl...@gmail.com> wrote in message
>
> news:36bf4dcb-4c9d-41e1-8b7f-6772ef5632f8@kg10g2000pbc.googlegroups.com...
> Superhuman AI will improve itself at an exponentially increasing rate
> then revolutionize all industrial processes almost instantaneously,
> ushering in a post-scarcity economy. Everyone will be able to live in
> a mansion, drive a supercar feast like a king, travel anywhere on
> earth for free, and have as many iPhones as they want.
>
> The only "commodities" that will be in short supply will be love,
> companionship, and similar intangible, touchy-feely nonsense. That's
> where the next round of super-fortunes will be made. In fact, it's
> where the last round of fortunes will be made. In a post-scarcity
> economy profits made from physical goods and services will be
> negligible, and making fortunes from them impossible.
>
> Two things follow:-
>
> If you want to make a fortune get into the industries that derive
> profit from human loneliness - cam-whores or something like that.
>
> ----------------------------------------------------------------------
>
> What drugs have you been taking? The real shortages will be raw materials,
> land, food, water, breathable air etc for the 10-20+ Billion people on the
> planet by then.
> Where the hell are you going to put those "mansions" for all of them, not to
> mention roads for all of those "supercars".
>
> Trevor.

Any fool knows hovercars don't need roads.

terryc

10/11/2012 12:39:00 AM

0

On 10/10/12 20:46, Wolfgang Wildeblood wrote:
> On Oct 10, 4:43 pm, Graham Cooper<grahamcoop...@gmail.com> wrote:
>
>> ok.... add your own summary here...
>
> Superhuman AI

Might rach a few fruitcakes to spell.

Wolfgang Wildeblood

10/11/2012 12:46:00 AM

0

On Oct 11, 8:37 am, "Trevor" <tre...@home.net> wrote:
> "Wolfgang Wildeblood" <wolfgangwildebl...@gmail.com> wrote in message
>
> news:8ad58d5e-15ea-498f-a046-a36c8bf22b62@vy11g2000pbb.googlegroups.com...
> On Oct 11, 7:26 am, "Trevor" <tre...@home.net> wrote:
>
> > "Wolfgang Wildeblood" <wolfgangwildebl...@gmail.com> wrote in message
> >news:36bf4dcb-4c9d-41e1-8b7f-6772ef5632f8@kg10g2000pbc.googlegroups.com....
> > Superhuman AI will improve itself at an exponentially increasing rate
> > then revolutionize all industrial processes almost instantaneously,
> > ushering in a post-scarcity economy. Everyone will be able to live in
> > a mansion, drive a supercar feast like a king, travel anywhere on
> > earth for free, and have as many iPhones as they want.
>
> > The only "commodities" that will be in short supply will be love,
> > companionship, and similar intangible, touchy-feely nonsense. That's
> > where the next round of super-fortunes will be made. In fact, it's
> > where the last round of fortunes will be made. In a post-scarcity
> > economy profits made from physical goods and services will be
> > negligible, and making fortunes from them impossible.
>
> > Two things follow:-
>
> > If you want to make a fortune get into the industries that derive
> > profit from human loneliness - cam-whores or something like that.
>
> > ----------------------------------------------------------------------
>
> > What drugs have you been taking? The real shortages will be raw materials,
> > land, food, water, breathable air etc for the 10-20+ Billion people on the
> > planet by then.
> > Where the hell are you going to put those "mansions" for all of them, not
> > to
> > mention roads for all of those "supercars".
> }Any fool knows hovercars don't need roads.
>
> ---------------------------
>
> Well yes you are a fool, but you never mentioned hover cars (which still
> need air space) and I note you don't address any of the other issues!
>
> Trevor.

Trev, your whinging doth not constitute "issues".

Graham Cooper

10/11/2012 12:50:00 AM

0

On Oct 11, 10:37 am, "Trevor" <tre...@home.net> wrote:
> "Wolfgang Wildeblood" <wolfgangwildebl...@gmail.com> wrote in message
> > mention roads for all of those "supercars".
> }Any fool knows hovercars don't need roads.
>
> ---------------------------
>
> Well yes you are a fool, but you never mentioned hover cars (which still
> need air space) and I note you don't address any of the other issues!
>
> Trevor.

Ground effect only needs a bit of clay or gravel.

http://pro1og.com/Spe...

might need the AI to drive the things though!

Herc

Trevor

10/11/2012 1:37:00 AM

0


"Wolfgang Wildeblood" <wolfgangwildeblood@gmail.com> wrote in message
news:8ad58d5e-15ea-498f-a046-a36c8bf22b62@vy11g2000pbb.googlegroups.com...
On Oct 11, 7:26 am, "Trevor" <tre...@home.net> wrote:
> "Wolfgang Wildeblood" <wolfgangwildebl...@gmail.com> wrote in message
> news:36bf4dcb-4c9d-41e1-8b7f-6772ef5632f8@kg10g2000pbc.googlegroups.com...
> Superhuman AI will improve itself at an exponentially increasing rate
> then revolutionize all industrial processes almost instantaneously,
> ushering in a post-scarcity economy. Everyone will be able to live in
> a mansion, drive a supercar feast like a king, travel anywhere on
> earth for free, and have as many iPhones as they want.
>
> The only "commodities" that will be in short supply will be love,
> companionship, and similar intangible, touchy-feely nonsense. That's
> where the next round of super-fortunes will be made. In fact, it's
> where the last round of fortunes will be made. In a post-scarcity
> economy profits made from physical goods and services will be
> negligible, and making fortunes from them impossible.
>
> Two things follow:-
>
> If you want to make a fortune get into the industries that derive
> profit from human loneliness - cam-whores or something like that.
>
> ----------------------------------------------------------------------
>
> What drugs have you been taking? The real shortages will be raw materials,
> land, food, water, breathable air etc for the 10-20+ Billion people on the
> planet by then.
> Where the hell are you going to put those "mansions" for all of them, not
> to
> mention roads for all of those "supercars".

}Any fool knows hovercars don't need roads.

---------------------------

Well yes you are a fool, but you never mentioned hover cars (which still
need air space) and I note you don't address any of the other issues!

Trevor.