close any connections at shutdown
Include stdio.h for size_t