getprotobyname don't work

A

arnaudhasard

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
 
A

arnaudhasard

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.
 
A

arnaudhasard

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...-afficher-page-reinstaller-sujet-222384-1.htm
To be short, rename
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock and
HKEY_LOCAL_MACHINE\System\CurrentControlSet\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

A. Sinan Unur

(e-mail address removed) wrote in
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...-afficher-page-reinstaller-sujet-222384-1.htm To be short,
rename HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\WinSock
and HKEY_LOCAL_MACHINE\System\CurrentControlSet\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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top