Close an open file descriptor.
The fd_close()
function is used to close an open file descriptor. For sockets, this function will flush the data before closing the socket.
Note
The fd_close()
function is used to close an open file descriptor. It releases any resources associated with the file descriptor.
For sockets, it is best practise to run sock_shutdown()
before closing, because otherwise it can have unexpected runtime and latency side affects in some wasm runtimes.