disable INTERNET_OPEN_FLAG_USE_EXISTING_CONNECT flag? (CHttpConnection)
I'm creating a multithreaded test program that will create HTTP connections to a server, with each thread creating its own CInternetSession and CHttpConnection object. However, I've noticed that if I created 30 threads all of them will be using the same TCP connection ("netstat"). It seems like there is a flag INTERNET_OPEN_FLAG_USE_EXISTING_CONNECT for CInternetSession object to use existing TCP connection, but I would like to disable this so each thread will create a new connection. I couldn't seem to find the opposite flag that will do this. Has anyone ever done this before?
# 1 Re: disable INTERNET_OPEN_FLAG_USE_EXISTING_CONNECT flag? (CHttpConnection)
It seems like there is a flag INTERNET_OPEN_FLAG_USE_EXISTING_CONNECT for CInternetSession object to use existing TCP connection, but I would like to disable this so each thread will create a new connection. I couldn't seem to find the opposite flag that will do this.Well, the opposite of setting a flag is to not set the flag.
- petter
# 2 Re: disable INTERNET_OPEN_FLAG_USE_EXISTING_CONNECT flag? (CHttpConnection)
http://www.samspublishing.com/library/content.asp?b=Visual_C_PlusPlus&seqNum=111&rl=1
check this link, you can get some help from here.
eguru at 2007-11-9 13:54:38 >

# 3 Re: disable INTERNET_OPEN_FLAG_USE_EXISTING_CONNECT flag? (CHttpConnection)
The flag is set by default by CInternetSession. I did try to set the entire flag to zero (INTERNET_OPEN_FLAG_USE_EXISTING_CONNECT is defined as a positive number) but same thing still happens.
Well, the opposite of setting a flag is to not set the flag.
- petter