native-descriptor
ErrorsCollection

native-descriptor

Synthesised documentation from type/IO/Socket type/IO/Socket/Async type/IO/Socket/Async/ListenSocket type/IO/Handle type/IO/CatHandle

From type/IO/Socket

See Original text in context

method native-descriptor()

This returns a value that the operating system would understand as a "socket descriptor" and is suitable for passing to a native function that requires a socket descriptor as an argument such as setsockopt.

From type/IO/Socket/Async

See Original text in context

method native-descriptor(--> Int)

Returns the file descriptor of this socket.

From type/IO/Socket/Async/ListenSocket

See Original text in context

method native-descriptor(--> Int)

Returns the corresponding file descriptor (SOCKET on Windows) for the listening socket.

From type/IO/Handle

See Original text in context

method native-descriptor(IO::Handle:D:)

This returns a value that the operating system would understand as a "file descriptor" and is suitable for passing to a native function that requires a file descriptor as an argument such as fcntl or ioctl.

From type/IO/CatHandle

See Original text in context

method native-descriptor(IO::CatHandle:D: --> Int:D)

Returns the native-descriptor of the currently active source handle or Nil if the source handle queue may get exhausted.

Since the CatHandle closes a source handle, once it's done with it, it's possible for successive source handles to have the same native descriptor, if they were passed to .new as Cool or IO::Path objects.

(my $f1 = 'foo'.IO).spurt: 'foo';
(my $f2 = 'bar'.IO).spurt: 'bar';
with IO::CatHandle.new: $f1$f2$*IN {
    repeat { .native-descriptor.say } while .next-handle;
    # OUTPUT: «13␤13␤9␤» 
}