Link to home
Start Free TrialLog in
Avatar of allie910
allie910

asked on

socket error #10053

hi all,

i'm using IDHTTP to get HTML file from ol website using this syntax :

IdHTTP1.Request.ProxyServer := ProxyAddress; Ā  //==> I'm using Proxy connection
IdHttp1.Request.ProxyPort := ProxyPort;
HTMLContent := IdHTTP1.Get(IEAddress);

the problem is .... after sometimes.... if I want to get the HTML content again.... I will get SOCKET ERROR #1005 with the message : Software caused connection abort.

is there anyone know how to solve this problem.?

thanks alot ;)
Avatar of Lee_Nover
Lee_Nover

here's the explanation from http://www.sockets.com/err_lst1.htm#DetailedErrorDescriptions:

WSAECONNABORTED (10053) Software caused connection abort.

Berkeley description: A connection abort was caused internal to your host machine. The software caused a connection abort because there is no space on the socket's queue and the socket cannot receive further connections.

WinSock description: Partly the same as Berkeley. The error can occur when the local network system aborts a connection. This would occur if WinSock aborts an established connection after data retransmission fails (receiver never acknowledges data sent on a datastream socket).

TCP/IP scenario: A connection will timeout if the local system doesn't receive an (ACK)nowledgement for data sent. It would also timeout if a (FIN)ish TCP packet is not ACK'd (and even if the FIN is ACK'd, it will eventually timeout if a FIN is not returned).

User suggestions: There are a number of things to check, that might help to identify why the failure occurred. Basically, you want to identify where the problem occurred.

Ping the remote host you were connected to. If it doesn't respond, it might be off-line or there may be a network problem along the way. If it does respond, then this problem might have been a transient one (so you can reconnect now), or the server application you were connected to might have terminated (so you might not be able to connect again).
Ping a local host to verify that your local network is still functioning (if on a serial connection, see next step)
Ping your local router address. If you're on a serial connection, your local router is the IP address of the host you initially logged onto with SLIP or PPP.
Ping a host on the same subnet as the host you were connected to (if you know one). This will verify that the destination network is functioning.
Try a "traceroute" to the host you were connected to. This won't reveal too much unless you know the router addresses at the remote end, but it might help to identify if the problem is somewhere along the way.
anyway my suggestion is to trap the error and do a sleep then try again :) if you keep getting this error then raise it notifing the user
Avatar of allie910

ASKER

humm.
I dont really understand what are you suggesting... but I think I got this error if thje connection is idle for a while.

basically I connect to a website to find an online price listed in the website. when I access for the first time it's ok..... second.... and so on... it is always OK (inittialy I got the error of connection closed gracefully, but I already solve that prob by trying to make the connect again).

but now the problem is... after I connect ... then after a while I didn't make any online query, when I make a new query it will give this Socket error.....

is there any way that I can free the socket..?? or anything..??
the code, if u don't mind :D


thanks alot
ASKER CERTIFIED SOLUTION
Avatar of Lee_Nover
Lee_Nover

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Russell Libby
Russell Libby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thankkkssss :D

btw, actually I tried another way, anyway I think this way is better ;)

I tried to disconnect the socket every time I finish... it also works.. :D

btw what's the difference btw disconnecting the socket and the connection (I mean the effect ?)

Thank you :D

allie910,

The whole reason for "keep-alives" in http server connections is this: If you plan on making multiple requests to the same server, it saves you from having to renegotiate the server (cocket) connection, which is time expensive.

Disconnection means that the socket layer must resolve and then negotiate with the server again when you wish to issue a new request.

In your situation, there isn't much choice because you may/may not issue requests back to the server... and if you do, it may (as you have already seen) not be in the time limit required by the server. Thus the server disconnects you.

Side note to this. You really should not have included me as an "assist" to this question, as Lee_Nover did answer the question for you. The "B" grade given is also a little questionable. It is in good taste to let the experts helping you have a chance to make sure that all your issues/comments/concerns are addressed.

Regards,
Russell


I don't mind the assist .. however the grade does bother me .. specialy because I provided a better alternative to your solution .. eg. providing the correct answer to your question
"btw, actually I tried another way, anyway I think this way is better ;)"

no hard feelings anyway :)