[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

rb_sys_fail(socket(2)) - errno == 0

Glen Holcomb

8/5/2008 6:16:00 PM

[Note: parts of this message were removed to make it a legal post.]

That is the error message I get when I try either of these methods for
creating an ICMP packet:

socket = Socket.new(Socket::PF_INET, Socket::SOCK_RAW, Socket::IPPROTO_ICMP)

or

with net-ping

icmp = Ping::ICMP.new('machine_name')

icmp.ping?

I am on Windows XP. The account I'm logged in as has local administrator
rights.


What I'm trying to do is check to see if a system is up before I try and
make a WIN32OLE connection to it as they take forever to time-out

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

8 Answers

Phill Davies

8/5/2008 6:34:00 PM

0

You can use Ping from the Ruby standard library.

require 'ping'
Ping.pingecho "google.com", <timeout>, <port>

Where timeout is the number of seconds to wait for a reply (defaults to
5) and port is the port to use (defaults to the 'echo' port)


Unless you have something more specific you are trying to do this ought
to work.

Glen Holcomb wrote:
> That is the error message I get when I try either of these methods for
> creating an ICMP packet:
>
> socket = Socket.new(Socket::PF_INET, Socket::SOCK_RAW,
> Socket::IPPROTO_ICMP)
>
> or
>
> with net-ping
>
> icmp = Ping::ICMP.new('machine_name')
>
> icmp.ping?
>
> I am on Windows XP. The account I'm logged in as has local
> administrator
> rights.
>
>
> What I'm trying to do is check to see if a system is up before I try and
> make a WIN32OLE connection to it as they take forever to time-out
>
> --
> "Hey brother Christian with your high and mighty errand, Your actions
> speak
> so loud, I can't hear a word you're saying."
>
> -Greg Graffin (Bad Religion)

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

Glen Holcomb

8/5/2008 6:41:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Tue, Aug 5, 2008 at 12:34 PM, Phill Davies <binary011010@verizon.net>wrote:

> You can use Ping from the Ruby standard library.
>
> require 'ping'
> Ping.pingecho "google.com", <timeout>, <port>
>
> Where timeout is the number of seconds to wait for a reply (defaults to
> 5) and port is the port to use (defaults to the 'echo' port)
>
>
> Unless you have something more specific you are trying to do this ought
> to work.
>
> Glen Holcomb wrote:
> > That is the error message I get when I try either of these methods for
> > creating an ICMP packet:
> >
> > socket = Socket.new(Socket::PF_INET, Socket::SOCK_RAW,
> > Socket::IPPROTO_ICMP)
> >
> > or
> >
> > with net-ping
> >
> > icmp = Ping::ICMP.new('machine_name')
> >
> > icmp.ping?
> >
> > I am on Windows XP. The account I'm logged in as has local
> > administrator
> > rights.
> >
> >
> > What I'm trying to do is check to see if a system is up before I try and
> > make a WIN32OLE connection to it as they take forever to time-out
> >
> > --
> > "Hey brother Christian with your high and mighty errand, Your actions
> > speak
> > so loud, I can't hear a word you're saying."
> >
> > -Greg Graffin (Bad Religion)
>
> --
> Posted via http://www.ruby-....
>
>
I was actually hoping for something that creates a real ICMP packet as I
can't be certain what ports are open on given workstations on the network.

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

Daniel Berger

8/5/2008 11:44:00 PM

0

Glen Holcomb wrote:
> On Tue, Aug 5, 2008 at 12:34 PM, Phill Davies <binary011010@verizon.net>wrote:
>
>> You can use Ping from the Ruby standard library.
>>
>> require 'ping'
>> Ping.pingecho "google.com", <timeout>, <port>
>>
>> Where timeout is the number of seconds to wait for a reply (defaults to
>> 5) and port is the port to use (defaults to the 'echo' port)
>>
>>
>> Unless you have something more specific you are trying to do this ought
>> to work.
>>
>> Glen Holcomb wrote:
>>> That is the error message I get when I try either of these methods for
>>> creating an ICMP packet:
>>>
>>> socket = Socket.new(Socket::PF_INET, Socket::SOCK_RAW,
>>> Socket::IPPROTO_ICMP)
>>>
>>> or
>>>
>>> with net-ping
>>>
>>> icmp = Ping::ICMP.new('machine_name')
>>>
>>> icmp.ping?
>>>
>>> I am on Windows XP. The account I'm logged in as has local
>>> administrator
>>> rights.
>>>
>>>
>>> What I'm trying to do is check to see if a system is up before I try and
>>> make a WIN32OLE connection to it as they take forever to time-out

It's a problem with the socket.so file that ships with the one click
installer. Take a look at this ticket for more information:

http://rubyforge.org/tracker/?func=detail&group_id=167&aid=9438&am...

Regards,

Dan

Heesob Park

8/6/2008 10:18:00 AM

0

2008/8/6 Daniel Berger <djberg96@gmail.com>:
> Glen Holcomb wrote:
>>
>> On Tue, Aug 5, 2008 at 12:34 PM, Phill Davies
>> <binary011010@verizon.net>wrote:
>>
>>> You can use Ping from the Ruby standard library.
>>>
>>> require 'ping'
>>> Ping.pingecho "google.com", <timeout>, <port>
>>>
>>> Where timeout is the number of seconds to wait for a reply (defaults to
>>> 5) and port is the port to use (defaults to the 'echo' port)
>>>
>>>
>>> Unless you have something more specific you are trying to do this ought
>>> to work.
>>>
>>> Glen Holcomb wrote:
>>>>
>>>> That is the error message I get when I try either of these methods for
>>>> creating an ICMP packet:
>>>>
>>>> socket = Socket.new(Socket::PF_INET, Socket::SOCK_RAW,
>>>> Socket::IPPROTO_ICMP)
>>>>
>>>> or
>>>>
>>>> with net-ping
>>>>
>>>> icmp = Ping::ICMP.new('machine_name')
>>>>
>>>> icmp.ping?
>>>>
>>>> I am on Windows XP. The account I'm logged in as has local
>>>> administrator
>>>> rights.
>>>>
>>>>
>>>> What I'm trying to do is check to see if a system is up before I try and
>>>> make a WIN32OLE connection to it as they take forever to time-out
>
> It's a problem with the socket.so file that ships with the one click
> installer. Take a look at this ticket for more information:
>
> http://rubyforge.org/tracker/?func=detail&group_id=167&aid=9438&am...
>
The socket.so has nothing to do with this problem.
It's a problem with the msvcrt-ruby18.dll file.

That bug is related to the winsock2 compatibility.

The OCI version was built with the flag '--with-winsock2'.
If you build ruby without '--with-winsock2', it will work fine.

Regards,

Park Heesob

Park Heesob

Daniel Berger

8/8/2008 1:34:00 PM

0



On Aug 5, 12:15=A0pm, "Glen Holcomb" <damnbig...@gmail.com> wrote:
> That is the error message I get when I try either of these methods for
> creating an ICMP packet:
>
> socket =3D Socket.new(Socket::PF_INET, Socket::SOCK_RAW, Socket::IPPROTO_=
ICMP)
>
> or
>
> with net-ping
>
> icmp =3D Ping::ICMP.new('machine_name')
>
> icmp.ping?
>
> I am on Windows XP. =A0The account I'm logged in as has local administrat=
or
> rights.
>
> What I'm trying to do is check to see if a system is up before I try and
> make a WIN32OLE connection to it as they take forever to time-out

It's a busted socket.so in the one click installer I'm afraid (who, in
turn, get it from the core team).

See http://rubyforge.org/tracker/?func=3Ddetail&group_id=3D167&aid=3D9...
tid=3D715
for more information.

Works fine when I use a version of Ruby built with VC++ 8.

Regards,

Dan

Daniel Berger

8/8/2008 1:43:00 PM

0



On Aug 6, 4:17=A0am, "Heesob Park" <pha...@gmail.com> wrote:
> 2008/8/6 Daniel Berger <djber...@gmail.com>:
>
>
>
> > Glen Holcomb wrote:
>
> >> On Tue, Aug 5, 2008 at 12:34 PM, Phill Davies
> >> <binary011...@verizon.net>wrote:
>
> >>> You can use Ping from the Ruby standard library.
>
> >>> require 'ping'
> >>> Ping.pingecho "google.com", <timeout>, <port>
>
> >>> Where timeout is the number of seconds to wait for a reply (defaults =
to
> >>> 5) and port is the port to use (defaults to the 'echo' port)
>
> >>> Unless you have something more specific you are trying to do this oug=
ht
> >>> to work.
>
> >>> Glen Holcomb wrote:
>
> >>>> That is the error message I get when I try either of these methods f=
or
> >>>> creating an ICMP packet:
>
> >>>> socket =3D Socket.new(Socket::PF_INET, Socket::SOCK_RAW,
> >>>> Socket::IPPROTO_ICMP)
>
> >>>> or
>
> >>>> with net-ping
>
> >>>> icmp =3D Ping::ICMP.new('machine_name')
>
> >>>> icmp.ping?
>
> >>>> I am on Windows XP. =A0The account I'm logged in as has local
> >>>> administrator
> >>>> rights.
>
> >>>> What I'm trying to do is check to see if a system is up before I try=
and
> >>>> make a WIN32OLE connection to it as they take forever to time-out
>
> > It's a problem with the socket.so file that ships with the one click
> > installer. Take a look at this ticket for more information:
>
> >http://rubyforge.org/tracker/?func=3Ddetail&group_id=3D167&aid=3D94...
id=3D715
>
> The socket.so has nothing to do with this problem.
> It's a problem with the msvcrt-ruby18.dll file.
>
> That bug is related to the winsock2 compatibility.
>
> The OCI version was built with the flag '--with-winsock2'.
> If you build ruby without '--with-winsock2', it will work fine.

My bad. Thanks for the clarification.

Dan

Glen Holcomb

8/8/2008 1:53:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Fri, Aug 8, 2008 at 7:43 AM, Daniel Berger <djberg96@gmail.com> wrote:

>
>
> On Aug 6, 4:17 am, "Heesob Park" <pha...@gmail.com> wrote:
> > 2008/8/6 Daniel Berger <djber...@gmail.com>:
> >
> >
> >
> > > Glen Holcomb wrote:
> >
> > >> On Tue, Aug 5, 2008 at 12:34 PM, Phill Davies
> > >> <binary011...@verizon.net>wrote:
> >
> > >>> You can use Ping from the Ruby standard library.
> >
> > >>> require 'ping'
> > >>> Ping.pingecho "google.com", <timeout>, <port>
> >
> > >>> Where timeout is the number of seconds to wait for a reply (defaults
> to
> > >>> 5) and port is the port to use (defaults to the 'echo' port)
> >
> > >>> Unless you have something more specific you are trying to do this
> ought
> > >>> to work.
> >
> > >>> Glen Holcomb wrote:
> >
> > >>>> That is the error message I get when I try either of these methods
> for
> > >>>> creating an ICMP packet:
> >
> > >>>> socket = Socket.new(Socket::PF_INET, Socket::SOCK_RAW,
> > >>>> Socket::IPPROTO_ICMP)
> >
> > >>>> or
> >
> > >>>> with net-ping
> >
> > >>>> icmp = Ping::ICMP.new('machine_name')
> >
> > >>>> icmp.ping?
> >
> > >>>> I am on Windows XP. The account I'm logged in as has local
> > >>>> administrator
> > >>>> rights.
> >
> > >>>> What I'm trying to do is check to see if a system is up before I try
> and
> > >>>> make a WIN32OLE connection to it as they take forever to time-out
> >
> > > It's a problem with the socket.so file that ships with the one click
> > > installer. Take a look at this ticket for more information:
> >
> > >
> http://rubyforge.org/tracker/?func=detail&group_id=167&aid=9438&am...
> >
> > The socket.so has nothing to do with this problem.
> > It's a problem with the msvcrt-ruby18.dll file.
> >
> > That bug is related to the winsock2 compatibility.
> >
> > The OCI version was built with the flag '--with-winsock2'.
> > If you build ruby without '--with-winsock2', it will work fine.
>
> My bad. Thanks for the clarification.
>
> Dan
>
>
Thanks guys.

--
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

Daniel Berger

8/8/2008 2:55:00 PM

0



On Aug 8, 7:33=A0am, Daniel Berger <djber...@gmail.com> wrote:
> On Aug 5, 12:15=A0pm, "Glen Holcomb" <damnbig...@gmail.com> wrote:
>
>
>
>
>
> > That is the error message I get when I try either of these methods for
> > creating an ICMP packet:
>
> > socket =3D Socket.new(Socket::PF_INET, Socket::SOCK_RAW, Socket::IPPROT=
O_ICMP)
>
> > or
>
> > with net-ping
>
> > icmp =3D Ping::ICMP.new('machine_name')
>
> > icmp.ping?
>
> > I am on Windows XP. =A0The account I'm logged in as has local administr=
ator
> > rights.
>
> > What I'm trying to do is check to see if a system is up before I try an=
d
> > make a WIN32OLE connection to it as they take forever to time-out
>
> It's a busted socket.so in the one click installer I'm afraid (who, in
> turn, get it from the core team).
>
> Seehttp://rubyforge.org/tracker/?func=3Ddetail&group_id=3D167&aid=3D...
atid=3D715
> for more information.
>
> Works fine when I use a version of Ruby built with VC++ 8.
>
> Regards,
>
> Dan

Ignore this dupe. Submitting replies via the Google groups interface
is seriously messed up. Lately about a third of my posts never arrive,
another third show up several days later (as this one did), with the
final third actually posting in a timely manner.

Dan