Getting 12031 or 12152 response on using wininet httpsendrequestex
I have a win32 application which uploads Images to the server continuously. 
But when i uses this, it uploads in such a way that 2 files uploads properly and the 3rd one fails(with an exception with last error 12031 or 12152). and the next 2 uploads will be success and the next request fails.

in most cases the error code is 12031. Which is connection Reset.
The file is send as a post  request, 

I am using the wininet apis to send the files. 
    HttpSendRequestEx and 
    HttpEndRequest

I am closing all connection handles and request handles after sending each request, as I have read that the Windows limits no.of open requests to a server.

But Some times the requests are successfully sent without any issues.
This behavior is not happened always. Is there any particular reason for this?

Also I cant believe its due to the limitation of maximum connections per server. in that case it should have failed always.... or is there any possibility to happen like this?

At the same time I have been using the same code in another application which doesnot have caused any such problem yet.



any idea about this??  please help....
Thanks in advance
Getting 12031 or 12152 response on using wininet httpsendrequestex
===

I have a win32 application which uploads Images to the server continuously. 
But when i uses this, it uploads in such a way that 2 files uploads properly and the 3rd one fails(with an exception with last error 12031 or 12152). and the next 2 uploads will be success and the next request fails.

in most cases the error code is 12031. Which is connection Reset.
The file is send as a post  request, 

I am using the wininet apis to send the files. 
    HttpSendRequestEx and 
    HttpEndRequest

I am closing all connection handles and request handles after sending each request, as I have read that the Windows limits no.of open requests to a server.

But Some times the requests are successfully sent without any issues.
This behavior is not happened always. Is there any particular reason for this?

Also I cant believe its due to the limitation of maximum connections per server. in that case it should have failed always.... or is there any possibility to happen like this?

At the same time I have been using the same code in another application which doesnot have caused any such problem yet.



any idea about this??  please help....
Thanks in advance