void ftp_fini() { if (ftp_initialized) { /* In order to "stop" the blocking sceNetAccept, * we have to close the server socket; this way * the accept call will return an error */ sceNetSocketClose(server_sockfd); /* Wait until the server threads ends */ sceKernelWaitThreadEnd(server_thid, NULL, NULL); /* To close the clients we have to do the same: * we have to iterate over all the clients * and shutdown their sockets */ client_list_thread_end(); /* Delete the client list mutex */ sceKernelDeleteMutex(client_list_mtx); client_list = NULL; sceNetCtlTerm(); sceNetTerm(); if (net_memory) { free(net_memory); net_memory = NULL; } ftp_initialized = 0; } }
/** * network_deinit: * * Deinitialize platform specific socket libraries. **/ void network_deinit(void) { #if defined(_WIN32) WSACleanup(); #elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__) cellNetCtlTerm(); sys_net_finalize_network(); cellSysmoduleUnloadModule(CELL_SYSMODULE_NET); #elif defined(VITA) sceNetCtlTerm(); sceNetTerm(); if (_net_compat_net_memory) { free(_net_compat_net_memory); _net_compat_net_memory = NULL; } #elif defined(GEKKO) && !defined(HW_DOL) net_deinit(); #elif defined(_3DS) socExit(); if(_net_compat_net_memory) { free(_net_compat_net_memory); _net_compat_net_memory = NULL; } #endif }
/** * Finish debugnet library * * @par Example: * @code * debugNetFinish(); * @endcode */ void debugNetFinish() { if (debugnet_initialized) { sceNetCtlTerm(); sceNetTerm(); if (net_memory) { free(net_memory); net_memory = NULL; } debugnet_initialized = 0; } }