int _tmain(int argc, _TCHAR* argv[])
{
	int num;
	int sockfd;
	curl_global_init(CURL_GLOBAL_ALL);
	CURLM *mh = curl_multi_init();

	CURL *eh = curl_easy_init();
	curl_easy_setopt(eh, CURLOPT_CONNECT_ONLY   ,1L);
	curl_easy_setopt(eh, CURLOPT_URL            ,"http://curl.haxx.se");
	curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION  ,write_callback);
	curl_easy_setopt(eh, CURLOPT_DEBUGFUNCTION  ,debug_callback);
	curl_easy_setopt(eh, CURLOPT_VERBOSE        ,1L);

	curl_multi_add_handle(mh,eh);

	do
	{
		curl_multi_perform(mh,&num);
		Sleep(10);
	}while(num);
	curl_easy_getinfo(eh, CURLINFO_LASTSOCKET, &sockfd);
	printf("last socket: %d\n",sockfd);


	curl_multi_remove_handle(mh,eh);
	curl_easy_cleanup(eh);

	CURL *eh2 = curl_easy_init();
	curl_easy_setopt(eh2, CURLOPT_CONNECT_ONLY    ,1L);
	curl_easy_setopt(eh2, CURLOPT_URL            ,"http://curl.haxx.se");
	curl_easy_setopt(eh2, CURLOPT_WRITEFUNCTION  ,write_callback);
	curl_easy_setopt(eh2, CURLOPT_DEBUGFUNCTION  ,debug_callback);
	curl_easy_setopt(eh2, CURLOPT_VERBOSE        ,1L);

	curl_multi_add_handle(mh,eh2);

	do
	{
		curl_multi_perform(mh,&num);
		Sleep(10);
	}while(num);

	curl_easy_getinfo(eh2, CURLINFO_LASTSOCKET, &sockfd);
	printf("last socket: %d\n",sockfd);

	curl_multi_remove_handle(mh,eh2);
	curl_easy_cleanup(eh2);

	curl_multi_cleanup(mh);
	curl_global_cleanup();
	return 0;
}
