develooper Front page | perl.perl5.porters | Postings from June 2015

Re: [perl #125465] shutdown() =?UTF-8?Q?doesn=E2=80=99t?= errorwhen socket is already closed

Thread Previous
From:
Dennis Kaarsemaker
Date:
June 26, 2015 08:05
Subject:
Re: [perl #125465] shutdown() =?UTF-8?Q?doesn=E2=80=99t?= errorwhen socket is already closed
Message ID:
1435305938.26582.14.camel@kaarsemaker.net
Only osx (and possibly the bsd it derives from) does that. On linux,
windows and possibly other OS'es, shutdows will succeed on an
unconnected socket.

See also https://code.google.com/p/py-amqplib/issues/detail?id=45 and
https://github.com/seveas/python-hpilo/issues/76 for more examples of
this issue.

On do, 2015-06-25 at 09:42 -0500, Felipe Gasper wrote:
> Sorry, I miscommunicated.
> 
> Failure seems to be what *should* happen, no?
> 
> I thought I had it failing on Linux, but here’s MacOS X 10.9:
> 
> -------------
> felipe@Macintosh-19 09:39:54 ~/code/io-die
>  > pbpaste | sudo perl
> Password:
> ok
> Can't shutdown($fh, '1'): Socket is not connected at - line 14
> 
> SIG? (127)
> felipe@Macintosh-19 09:41:00 ~/code/io-die
>  > uname -a
> Darwin Macintosh-19.local 13.4.0 Darwin Kernel Version 13.4.0: Wed Mar 
> 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64 x86_64
> -------------
> 
> -F
> 
> On 25 Jun 2015 1:39 AM, Tony Cook via RT wrote:
> > On Tue Jun 23 08:08:44 2015, felipe@felipegasper.com wrote:
> >> Perl's shutdown() command indicates an error in most OSes, but
> >> I find that, in NetBSD, it doesn't:
> >
> > Running your code on Linux:
> >
> > tony@mars:~/play$ perl sshutdown.pl
> > ok
> > ok 2
> >
> > On Solaris 11:
> >
> > tony@nereid:~/play$ perl sshutdown.pl
> > ok
> > ok 2
> >
> > On NetBSD 5.1:
> >
> > deimos$ perl ./sshutdown.pl
> > ok
> > ok 2
> >
> > So which systems does it fail on?
> >
> > Tony
> >
> 

-- 
Dennis Kaarsemaker
http://www.kaarsemaker.net


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About