Closes the file associated with the stream and disassociates it. All internal buffers associated with the stream are disassociated from it and flushed: the ...
The fclose() function flushes the stream pointed to by stream (writing any buffered output data using fflush(3)) and closes the underlying file descriptor.
It is very important to make sure you clear any incoming packets out of the incoming buffer using fread() or some equivalent. Although you can call fclose() the ...