For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > January 2006 > getprotobyname don't work









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author getprotobyname don't work
arnaudhasard@yahoo.fr

2006-01-25, 7:03 pm


On my configuration (Windows 2000), the following command line doesn't
print any results :

perl -e "print getprotobyname tcp"

On 2 different systems, (same OS and the same perl version), the
correct line (tcpTCP6) is printed. I think it is a bind problem between
the perl built-in function and the corresponding system call.

Actually, no script using "IO::Socket" is working (error "Can't
connect" during the creation of a new socket), but scripts using
"Socket" or "HTTP::Lite" work well.

Thank you for any help.


perl -v

This is perl, v5.8.7 built for MSWin32-x86-multi-thread
(with 14 registered patches, see perl -V for more detail)

Copyright 1987-2005, Larry Wall

Binary build 815 [211909] provided by ActiveState
http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Nov 2 2005 08:44:52

arnaudhasard@yahoo.fr

2006-01-25, 7:03 pm

I should add that :
- yes, connexions work with other langages (C, C++, ...) and/or other
softwares (internet browser, telnet, ...), the only problem concern
Perl.
- no, it's not a problem of a file nammed "protocol", this file is
right there where it should
- perl version and OS was recently updated
- also tested with PXPerl and Perl into Cygwin => same problem...

Is it a bug of Socket.pm ? I check but did not found any information
yet.

Thank you for any help.

arnaudhasard@yahoo.fr

2006-01-29, 6:58 pm

As nobody seems to have the answer, i am glad to tell that i finally
found the problem.

First, i observe that it was a OS-related problem, not a perl-related
problem.

For instance, with the last version of PHP, the following command did
not produce the correct result (in this case, it should print "6") :

<> echo "<?php print getprotobyname('tcp'); ?>" | php

The fact was that some internet-programs like the google desktop search
bar or spywares destroy some reg keys corresponding to Winsock (ie the
TCP/IP stack of Windows).

As nobody seems to notice the relationship between the two, and as this
"bug" could rot the life of somebody else, i prefer to include the
solution which helped me.

See (in french) :
http://forum.hardware.fr/hardwarefr...et-222384-1.htm
To be short, rename
HKEY_LOCAL_MACHINE\System\CurrentControl
Set\Services\WinSock and
HKEY_LOCAL_MACHINE\System\CurrentControl
Set\Services\WinSock2, and
desinstall/reinstall TCP/IP in the properties of your network card.

Solution also cross-posted there =>
http://bugs.activestate.com/show_bug.cgi?id=44288
As I firstly think it was a Perl-bug.

A. Sinan Unur

2006-01-29, 6:58 pm

arnaudhasard@yahoo.fr wrote in
news:1138548750.404666.52390@g43g2000cwa.googlegroups.com:

> As nobody seems to have the answer, i am glad to tell that i finally
> found the problem.


Thank you very much for posting the solution here (and choosing a
relevant subject line), so that others who might run into the same
problem can find it.

I had tried to re-create the problems on the four different
versions of Windows I have access to, and had failed to do so.

> The fact was that some internet-programs like the google desktop
> search bar or spywares destroy some reg keys corresponding to Winsock
> (ie the TCP/IP stack of Windows).


That explains it.

> See (in french) :
> http://forum.hardware.fr/hardwarefr...et-222384-1.htm To be short,
> rename HKEY_LOCAL_MACHINE\System\CurrentControl
Set\Services\WinSock
> and HKEY_LOCAL_MACHINE\System\CurrentControl
Set\Services\WinSock2, and
> desinstall/reinstall TCP/IP in the properties of your network card.
>
> Solution also cross-posted there =>
> http://bugs.activestate.com/show_bug.cgi?id=44288
> As I firstly think it was a Perl-bug.


Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/c...guidelines.html

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com