Thanks and I have some new data.
I have tried this snippit of code:

------------------------
#!/usr/bin/perl

        use IO::Socket;
        print "Content-type: text/html\n\n";
        print "OS: " . $^O . "<br>\n";
        print "Perl version: " . $] . "<br>\n";
        print "IO::Socket version: $IO::Socket::VERSION<br>\n";
        eval { IO::Socket::INET->new(q(www.perl.com:80)) || die; };
        print "$@<br>\n";
        print "getprotobyname: " . (getprotobyname('tcp'))[2] . "<br>\n";

        exit;
1
------------------------
results:
------------------------
OS: MSWin32
Perl version: 5.00503
IO::Socket version: 1.1603
IO::Socket::INET: Cannot determine protocol ...propagated at d:\**ip
hidden**\cgi-bin\sockettest.cgi line 8.
getprotobyname:
------------------------

Obviously 'getprotobyname' is causing the failure.  Does 'getprotobyname'
link to the
server somehow? Through a file?  Is this the /etc/protocols file you
mentioned?

---------------
>From a Novell website I find:
4.3.3. getprotobyname and getprotobynumber

These functions are implemented within the WinSock 2 DLL by consulting a
local protocols database. They do not result in any name resolution query.

---------------
>From the Microsoft Product Support pages:
getprotobyname() and getprotobynumber():
Check the PROTOCOL file at winnt\system32\drivers\etc.

Trying to read this directory results in an error.
Trying to read this file also results in an error.


Now I suppose I have to persuade the folks at Tech Support
that the error is on their side of the aggreement.

Will Ellis
-------------------------------

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Gisle Aas
> Sent: Friday, November 23, 2001 12:26 PM
> To: William R. Ellis
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: 500-Cannot determine protocol (rehash)
>
>
> "William R. Ellis" <[EMAIL PROTECTED]> writes:
>
***snip***
>
> "/etc/protocols" is what the file is called on Unix systems.  What it
> is on Windows I have no clue.
>
> The failure will not show up until you try to connect to a server.
> Try this code:
>
>   perl -le "use IO::Socket; print
> IO::Socket::INET->new(q(www.perl.com:80))||die"
>
> It should print something like "IO::Socket::INET=GLOB(0x811325c)".  I
> assume it will print something  with "Cannot determine protocol" for you.
> If it does, fix that!
>
> The code that triggers this error is this one (in IO/Socket.pm of
> perl5.005):
>
>     $proto ||= (getprotobyname "tcp")[2];
>     return _error($fh,'Cannot determine protocol')
>         unless($proto);
>
> This error check seems to simply be removed in the IO/Socket/INET.pm of
> perl-5.6.1 (and IO-1.20).  I don't know why.  Perhaps Graham remembers?
>
> Regards,
> Gisle
>

Reply via email to