talluritrk
August 7th, 2002, 11:01 AM
Hi Every body,
I am using HTTP library in my application based on eVC++. The code is shown below.
HINTERNET hINTERNET1 ,hINTERNET2 , hINTERNET3 ;
hINTERNET1 = InternetOpen ( NULL ,INTERNET_OPEN_TYPE_PRECONFIG , NULL , NULL , INTERNET_INVALID_PORT_NUMBER ) ;
hINTERNET2 = InternetConnect ( hINTERNET1 , IP , port , L"" , L"" , INTERNET_SERVICE_HTTP , 0 , 0 ) ;
hINTERNET3 = HttpOpenRequest ( hINTERNET2 , L"POST" , NULL , NULL , NULL , NULL , INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP , 213 ) ;
Here "IP" is the IP-address of the Server and "port" in the Port of the HTTP Server.
After Posting the data I am closing the HINTERNET handles. This piece of code is executed in one thread.
Again in another application ( basically different thread ) if I write the same piece of code and try to execute the
same, it is showing error in the line ....
hINTERNET2 = InternetConnect ( hINTERNET1 , IP , port , L"" , L"" , INTERNET_SERVICE_HTTP , 0 , 0 ) ;
So my question is , If I create the handles using InternetOpen, InternetConnect and HttpOpenRequest in " ONE THREAD "
can't I create the Handles using the same server Ip and port in " DIFFERENT THREAD "
Please Help me out
Thanks
RamaKrishna
I am using HTTP library in my application based on eVC++. The code is shown below.
HINTERNET hINTERNET1 ,hINTERNET2 , hINTERNET3 ;
hINTERNET1 = InternetOpen ( NULL ,INTERNET_OPEN_TYPE_PRECONFIG , NULL , NULL , INTERNET_INVALID_PORT_NUMBER ) ;
hINTERNET2 = InternetConnect ( hINTERNET1 , IP , port , L"" , L"" , INTERNET_SERVICE_HTTP , 0 , 0 ) ;
hINTERNET3 = HttpOpenRequest ( hINTERNET2 , L"POST" , NULL , NULL , NULL , NULL , INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP , 213 ) ;
Here "IP" is the IP-address of the Server and "port" in the Port of the HTTP Server.
After Posting the data I am closing the HINTERNET handles. This piece of code is executed in one thread.
Again in another application ( basically different thread ) if I write the same piece of code and try to execute the
same, it is showing error in the line ....
hINTERNET2 = InternetConnect ( hINTERNET1 , IP , port , L"" , L"" , INTERNET_SERVICE_HTTP , 0 , 0 ) ;
So my question is , If I create the handles using InternetOpen, InternetConnect and HttpOpenRequest in " ONE THREAD "
can't I create the Handles using the same server Ip and port in " DIFFERENT THREAD "
Please Help me out
Thanks
RamaKrishna