BOOL cg_upnp_ssdp_server_stop(CgUpnpSSDPServer *server)
{
	cg_log_debug_l4("Entering...\n");

	if (server->recvThread != NULL) {
		cg_thread_stop(server->recvThread);
		cg_thread_delete(server->recvThread);
		server->recvThread = NULL;
	}
	return TRUE;

	cg_log_debug_l4("Leaving...\n");
}
/**
 * cg_upnp_device_advertiser_stop
 *
 * Stop the advertiser thread for the given device
 *
 * \param dev Device that is being advertised
 */
BOOL cg_upnp_device_advertiser_stop(CgUpnpDevice *dev)
{
    CgThread *advertiser;

    cg_log_debug_l4("Entering...\n");

    /* Get the advertiser thread from the device struct */
    advertiser = cg_upnp_device_getadvertiserthead(dev);

    //Theo Beisch
    if (advertiser != NULL)
         return cg_thread_stop(advertiser);
    return FALSE;
}
Exemple #3
0
BOOL cg_bittorrent_client_stop(CgBittorrentClient *cbc)
{
	if (cbc->httpServer)
		cg_http_server_stop(cbc->httpServer);

	if (cbc->acceptThread) {
		cg_thread_stop(cbc->acceptThread);
		cg_thread_delete(cbc->acceptThread);
		cbc->acceptThread = NULL;
	}

	if (cbc->clientThreads) {
		cg_threadlist_stop(cbc->clientThreads);
		cg_threadlist_delete(cbc->clientThreads);
		cbc->clientThreads = NULL;
	}

	return TRUE;
}
BOOL cg_http_server_stop(CgHttpServer *httpServer)
{
	cg_log_debug_l4("Entering...\n");

	if (httpServer->acceptThread != NULL) {
		cg_thread_stop(httpServer->acceptThread);
		cg_thread_delete(httpServer->acceptThread);
		httpServer->acceptThread = NULL;
	}
	/**** Thanks for Makela Aapo (10/31/05) ****/
	if (httpServer->clientThreads != NULL) {
		cg_threadlist_stop(httpServer->clientThreads);
		cg_threadlist_delete(httpServer->clientThreads);
		httpServer->clientThreads = NULL;
	}

	cg_log_debug_l4("Leaving...\n");

	return TRUE;
}