txt: ## native-descriptor.md
  native-descriptor
  
  Combined from primary sources listed below.
  
  # [In IO::Socket::Async](#___top "go to top of document")[§](#(IO::Socket::Async)_method_native-descriptor "direct link")
  
  See primary documentation
  [in context](/type/IO/Socket/Async#method_native-descriptor)
  for **method native-descriptor**.
  
  ```raku
  method native-descriptor(--> Int)
  ```
  
  Returns the file descriptor of this socket.
  
  # [In IO::Socket::Async::ListenSocket](#___top "go to top of document")[§](#(IO::Socket::Async::ListenSocket)_method_native-descriptor "direct link")
  
  See primary documentation
  [in context](/type/IO/Socket/Async/ListenSocket#method_native-descriptor)
  for **method native-descriptor**.
  
  ```raku
  method native-descriptor(--> Int)
  ```
  
  Returns the corresponding file descriptor (`SOCKET` on Windows) for the listening socket.
  
  # [In IO::Handle](#___top "go to top of document")[§](#(IO::Handle)_method_native-descriptor "direct link")
  
  See primary documentation
  [in context](/type/IO/Handle#method_native-descriptor)
  for **method native-descriptor**.
  
  ```raku
  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`.
  
  # [In role IO::Socket](#___top "go to top of document")[§](#(role_IO::Socket)_method_native-descriptor "direct link")
  
  See primary documentation
  [in context](/type/IO/Socket#method_native-descriptor)
  for **method native-descriptor**.
  
  ```raku
  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`.
  
  # [In IO::CatHandle](#___top "go to top of document")[§](#(IO::CatHandle)_method_native-descriptor "direct link")
  
  See primary documentation
  [in context](/type/IO/CatHandle#method_native-descriptor)
  for **method native-descriptor**.
  
  ```raku
  method native-descriptor(IO::CatHandle:D: --> Int:D)
  ```
  
  Returns the [native-descriptor](/type/IO/Handle#method_native-descriptor) of the currently active source handle or [`Nil`](/type/Nil) if the [source handle queue has been exhausted](/type/IO/CatHandle#method_next-handle).
  
  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](/type/IO/CatHandle#method_new) as [`Cool`](/type/Cool) or [`IO::Path`](/type/IO/Path) objects.
  
  ```raku
  (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␤»
  }
  
  ```
  