Good day. Is the socket descriptor ( SOCKET ) returned by the socket creation functions ( socket() , accept() ) unique within the process?

The official proof interests (the link to, or the standard, or something similar)

  • Unique (but not prohibited by two sockets per address + port connects) - nick_n_a
  • one
    And how do you imagine the situation when the socket descriptor is not unique within the process? Here you called send , passing it a socket descriptor, how will this function distinguish which of the two non-unique sockets was implied? Another issue is that the values ​​of these descriptors can be reused after closing. - VTT
  • one
    And this is an interesting question, because MSDN does not indicate the uniqueness of the socket. You can look at MSDN in other languages, sometimes there are disagreements in the description. I myself once used Russian MSDN for protection in the tender, although there was other information in the English version - Mishakov Maxim
  • I deciphered the socket to IDA - it is a standard structure similar to LocalAlloc (several bytes), which is wrapped around the "source". The source - in some% of cases - the file descriptor of the driver, which is accessed via DeviceIoControl. - nick_n_a
  • @VTT, here is a question in proofs that need to be provided in the software documentation, logically it is clear that the descriptor must be unique. I have information about the descriptors in linux, where it is described in detail how they are issued, how they are numbered, how they are reused, etc. I would like the same information for windows from a confirmed source. - goldstar_labs

0