boundSocket.fd()
- 返回:<integer> 底层操作系统的文件描述符,或者在不为套接字提供文件描述符的平台(如 Windows)上为
-1。
返回绑定套接字的文件描述符。所有权仍然属于 BoundSocket,所以调用者不能关闭该描述符。该描述符只在句柄被接管之前可用;之后它属于接管的 net.Server 或 net.Socket,并且 fd() 会抛出 ERR_SOCKET_HANDLE_ADOPTED。
🌐 Returns the file descriptor of the bound socket. Ownership remains with the
BoundSocket, so the descriptor must not be closed by the caller. The
descriptor is only available before the handle is adopted; afterwards it belongs
to the adopting net.Server or net.Socket and fd() throws
ERR_SOCKET_HANDLE_ADOPTED.