Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO::Socket->connected raises warning if socket doesn't yet have a filehandle [rt.cpan.org #63052] #17456

Open
toddr opened this issue Apr 19, 2018 · 0 comments
Labels
Bug dist-IO issues in the dual-life blead-first IO distribution

Comments

@toddr
Copy link
Member

toddr commented Apr 19, 2018

Migrated from rt.cpan.org#63052 (status was 'new')

Requestors:

From [email protected] on 2010-11-16 18:16:44:

Create a new IO::Socket without yet a filehandle inside it.

->connected accessor throws a warning:

  getpeername() on unopened socket GEN1 at 
/usr/lib/perl/5.10/IO/Socket.pm line 257.

This accessor can be easily fixed by testing if it's even open first; 
perhaps by checking

  defined fileno($sock) and getpeername($sock);

-- 

Paul Evans
@toddr toddr transferred this issue from Dual-Life/IO Jan 20, 2020
@toddr toddr added Needs Triage dist-IO issues in the dual-life blead-first IO distribution labels Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug dist-IO issues in the dual-life blead-first IO distribution
Projects
None yet
Development

No branches or pull requests

3 participants