Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement native-descriptor on handles/sockets.
Provides a way to get the (platform-specific) file descriptor, HANDLE,
etc.
  • Loading branch information
jnthn committed Dec 14, 2015
1 parent 03cbe70 commit a819231
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/core/IO/Handle.pm
Expand Up @@ -849,6 +849,10 @@ my class IO::Handle does IO {
IO::Notification.watch-path($!path);
}
#?endif

method native-descriptor(IO::Handle:D:) {
nqp::filenofh($!PIO)
}
}

# vim: ft=perl6 expandtab sw=4
4 changes: 4 additions & 0 deletions src/core/IO/Socket.pm
Expand Up @@ -87,6 +87,10 @@ my role IO::Socket does IO {
nqp::closefh($!PIO);
$!PIO := Mu;
}

method native-descriptor(::?CLASS:D:) {
nqp::filenofh($!PIO)
}
}

# vim: ft=perl6 expandtab sw=4
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2015.11-45-g044d4dd
2015.11-47-gcf246d6

0 comments on commit a819231

Please sign in to comment.