Board index » delphi » Indy 10 and winsock error 10053

Indy 10 and winsock error 10053


2007-11-28 08:09:45 AM
delphi47
Hello,
I am trying to POST to a web service using Indy 10 over and SSL connection.
The process works fine for most requests, but when my data gets too large (5
MB or so) it suddenly throws a socket exception with the error code 10053.
The strange thing it that it does this on the third packet of data, not
somewhere in the middle as I'd expect. If I send a 3 MB block of data,
it passes the third packet just fine, in fact, it sends the entire request.
Does anyone have any pointers on how to go about tracking this down?
Thanks,
Don
 
 

Re:Indy 10 and winsock error 10053

"Don Wilcox" <XXXX@XXXXX.COM>writes
Quote
when my data gets too large (5 MB or so) it suddenly
throws a socket exception with the error code 10053.
WSAECONNABORTED (10053)
Software caused connection abort.
An established connection was aborted by the software in your host machine,
possibly due to a data transmission timeout or protocol error.
Quote
Does anyone have any pointers on how to go about tracking this down?
Please show your actual code.
Gambit
 

Re:Indy 10 and winsock error 10053

It is in C++. I post here only because the traffic is better.
void Execute(TIdHTTP *http) {
if (svc.SubString(1, 5) == "https") {
// Need an SSL IOHandler
TIdSSLIOHandlerSocketOpenSSL *ioh = new
TIdSSLIOHandlerSocketOpenSSL(http);
ioh->Port = 443;
ioh->UseNagle = false;
} // if
if (FOnConnected) http->OnConnected = HTTPConnected;
if (FOnProgress) {
http->OnWorkBegin = HTTPWorkBegin;
http->OnWork = HTTPWork;
http->OnWorkEnd = HTTPWorkEnd;
} // if
std::auto_ptr<TMemoryStream>req(new TMemoryStream);
req->Write(rqXML.data(), rqXML.Length());
req->Position = 0;
// Add the SOAPAction HTTP Header to the Request
String hdr = "SOAPAction: \"" + fAction.Server + fAction.Name + "\"";
http->Request->CustomHeaders->Clear();
http->Request->CustomHeaders->Add(hdr);
http->Request->Accept = "text/xml";
http->Request->AcceptCharSet = "utf-8";
http->Request->ContentType = "text/xml";
// Do it
resultStream->Clear();
http->Post(svc, req.get(), resultStream);
}
Again, it works up to something less than 8MB. Itgets to the third packet,
sits for a long time (30 seconds or so) then up comes the exception.
Don
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"Don Wilcox" <XXXX@XXXXX.COM>writes
news:474cb1cd$XXXX@XXXXX.COM...

>when my data gets too large (5 MB or so) it suddenly
>throws a socket exception with the error code 10053.

WSAECONNABORTED (10053)

Software caused connection abort.

An established connection was aborted by the software in your host
machine,
possibly due to a data transmission timeout or protocol error.

>Does anyone have any pointers on how to go about tracking this down?

Please show your actual code.


Gambit


 

Re:Indy 10 and winsock error 10053

"Don Wilcox" <XXXX@XXXXX.COM>writes
Quote
It is in C++. I post here only because the traffic is better.
Please don't do that. There is plenty of traffic in the C++ newsgroups.
Quote
if (svc.SubString(1, 5) == "https") {
// Need an SSL IOHandler
TIdSSLIOHandlerSocketOpenSSL *ioh = new
TIdSSLIOHandlerSocketOpenSSL(http);
ioh->Port = 443;
ioh->UseNagle = false;
} // if
You are instantiating an SSL IOHandler, but you are not actually assigning
it to the TIdHTTP at all.
Quote
std::auto_ptr<TMemoryStream>req(new TMemoryStream);
req->Write(rqXML.data(), rqXML.Length());
Did you verify that Write() is actualy writing all of the data in full?
Write() has a return value that indicates the number of bytes actually
written to the stream.
Rather than using TMemoryStream, how about TStringStream instead?
std::auto_ptr<TStringStream>req(new TStringStream(rqXML));
Then you are not making a second copy of the data at all.
Quote
// Add the SOAPAction HTTP Header to the Request
String hdr = "SOAPAction: \"" + fAction.Server + fAction.Name + "\"";
http->Request->CustomHeaders->Clear();
http->Request->CustomHeaders->Add(hdr);
http->Request->CustomHeaders->Values["SOAPAction"] = \"" +
fAction.Server + fAction.Name + "\";
Quote
Again, it works up to something less than 8MB.
You said 5 MB earlier.
Quote
It gets to the third packet
How are you determining that? How large are the packets?
Gambit