Archived Forum Post

Index of archived forum posts

Question:

http socket error at several downloads

Sep 03 '13 at 11:30

Hello,

i like to download several items from an server.

if i do this, it do what i want:

for (int i =0; i< n; i++) { CkHttp http; http.UnlockComponent("xzy"); CkByteData binaryData; bool success = http.QuickGet(address.c_str(),binaryData) }

but if i do this, i wont work:

CkHttp http; http.UnlockComponent("xzy"); for (int i =0; i< n; i++) { CkHttp http; http.UnlockComponent("xzy");

CkByteData binaryData; bool success = http.QuickGet(address.c_str(),binaryData) }

success is false and i get: SOCKET_ERROR: An established connection was aborted by the software in your host machine.

So if i make a new object for each download it will work. but if i use the same object it wont. what do i wrong?

if find this blog: http://www.chilkatsoft.com/p/p_299.asp, my english so not good. i dont see a solution in here :(

thanks a lot for your help


Answer

I'd need to see the full LastErrorText to make more sense of it. Please post using "pre" tags to maintain the readability of the LastErrorText. (I will ignore the response if it is not readable.)


Answer

sorry for the late answer. i wasnt at work.

here is the error code:

<get_url>http://localhost/test.bmp</get_url>
<info>Using existing connection to web server...</info>
<info>-- BuildGetRequest --</info>
<info>Not auto-adding cookies.</info>
<info>Adding Basic Authentication Header</info>
<login>XXXXXXXXX</login>
<sendElapsedMs>0</sendElapsedMs>
<error><![CDATA[SOCKET_ERROR: Eine bestehende Verbindung wurde softwaregesteuert
durch den Hostcomputer abgebrochen.]]></error>
<numBytesRequested>1</numBytesRequested>
<error>Failed to receive data on the TCP socket</error>
<error>Failed to get response header</error>

Eine bestehende Verbindung wurde softwaregesteuert durch den Hostcomputer abgebrochen = An existing connection was controlled by software aborted by the host computer

Thanks a lot :)


Answer

and also a problem, how can i check if the server is down? is there a funktion?


Answer

when i make a request with an objekt it runs perfekt.

if i make than a neq request with the same objket than it dont run. at the third time it runs. The Error log shows me at the second try "An existing connection was controlled by software aborted by the host computer".

can pls someone help me, i have no solution for this. :(


Answer

Try using the same object instance for each request:

CkHttp http; 
http.UnlockComponent("xzy");
CkByteData binaryData;

for (int i =0; i< n; i++)
{
binaryData.clear();
bool success = http.QuickGet(address.c_str(),binaryData)
}

Answer

yes i do this and there is my problem: ;(

in debug mode every second objekt make an error: "An existing connection was controlled by software aborted by the host computer".

in release mode it seems to run.

have i to clear the http objekt?


Answer

Unfortunately, today the 30 day trial expired. the 30 days are not really over yet. I am not 100% shure but i uses the library first time on Aug. 10 2013.

Is there a possibility to test your library a few more days to handle this problem?

Thanks a lot!