getprotobyname don't work

Discussion in 'Perl Misc' started by arnaudhasard@yahoo.fr, Jan 25, 2006.

  1. Guest

    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
    , Jan 25, 2006
    #1
    1. Advertising

  2. Guest

    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.
    , Jan 25, 2006
    #2
    1. Advertising

  3. Guest

    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.
    , Jan 29, 2006
    #3
  4. wrote in
    news::

    > 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
    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    A. Sinan Unur, Jan 29, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DP
    Replies:
    0
    Views:
    1,140
  2. Shaw
    Replies:
    1
    Views:
    334
    Carl Prothman [MVP]
    Jul 10, 2003
  3. Uriy leyfm

    Server Controls don't work properly

    Uriy leyfm, Jul 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    304
  4. jalkadir
    Replies:
    2
    Views:
    375
  5. Jason
    Replies:
    0
    Views:
    194
    Jason
    Jul 6, 2004
Loading...

Share This Page