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::INET's send() on a non-existent port silently kills Rakudo #1297

Closed
p6rt opened this issue Sep 19, 2009 · 8 comments
Closed

IO::Socket::INET's send() on a non-existent port silently kills Rakudo #1297

p6rt opened this issue Sep 19, 2009 · 8 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 19, 2009

Migrated from rt.perl.org#69232 (status was 'resolved')

Searchable as RT69232$

@p6rt
Copy link
Author

p6rt commented Sep 19, 2009

From @carbin

For me, at least

my $s = IO​::Socket​::INET.new; $s.open('127.0.0.1', 80); $s.send('foo'); say "Lorem ipsum"; # I have Apache running on port 80 so this will work
Lorem ipsum

carlin@​cerberus​:~$ perl6

my $s = IO​::Socket​::INET.new; $s.open('127.0.0.1', 42); $s.send('foo'); say "Lorem ipsum"; # Nothing on port 42
carlin@​cerberus​:~$

GDB says​:

my $s = IO​::Socket​::INET.new; $s.open('127.0.0.1', 42); $s.send('foo'); say "Lorem ipsum"; # Nothing on port 42

Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7f3272aad700 (LWP 6231)]
0x00007f3271c66465 in send () from /lib/libpthread.so.0

--
Carlin

@p6rt
Copy link
Author

p6rt commented May 30, 2010

From mestre.smash@gmail.com

Currently the IO​::Socket​::INET module is failing if can't create a
socket. In the meantime you have to 'use fatal;' in order to actually
see the message but that will change when void context detection is
implemented.

http://github.com/rakudo/rakudo/commit/5fc925ce246733a074a47c06bddd9c0d9effde0f

--
./smash

@p6rt
Copy link
Author

p6rt commented May 30, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 15, 2012

From @bbkr

On 2012.10 its

$ perl6 -e 'my $s = IO​::Socket​::INET.new; $s.open("127.0.0.1", 42); $s.send("foo"); say "Lorem
ipsum";'
Nothing given for new socket to connect or bind to
  in method <anon> at src/gen/CORE.setting​:9956
  in at src/gen/Metamodel.pm​:2401
  in any find_method_fallback at src/gen/Metamodel.pm​:2389
  in any find_method at src/gen/Metamodel.pm​:925
  in block at -e​:1

@p6rt
Copy link
Author

p6rt commented Nov 15, 2012

From @bbkr

So now error is misleading because it's not true that "nothing was given to bind to", it was failed
binding.

@p6rt
Copy link
Author

p6rt commented Jan 24, 2013

From @FROGGS

Are you sure it should work with positionals passed to .open instead of
named args passed to .new?

perl6 -e 'my $s = IO​::Socket​::INET.new(host => "127.0.0.1", port => 42);
$s.send("foo"); say "Lorem ipsum";'
Gives me​: connect failed​: Connection refused

@p6rt
Copy link
Author

p6rt commented Jan 24, 2013

From @carbin

Are you sure it should work with positionals passed to .open instead of named args passed to .new?

perl6 -e 'my $s = IO​::Socket​::INET.new(host => "127.0.0.1", port => 42); $s.send("foo"); say "Lorem ipsum";'
Gives me​: connect failed​: Connection refused

I believe the API for IO​::Socket​::INET has changed since this bug was originally filed (back in 2009!), so yes, the current behaviour looks correct.

@p6rt
Copy link
Author

p6rt commented Jan 24, 2013

@FROGGS - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 24, 2013
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant