Delphi 2009 - Indy 10.5.5, IDHttp with SLL randomly getting socket error #0

Hello,

I am using Delphi 2009 with a recent Indy 10.5.5 development snapshot.  In my code I am using a TIDHttp with TIDSSLIOHandlerSocketOpenSSL.  The Open SLL .dlls I am using is from the the indy website and are openssl-0.9.8k-i386-win32.  The issue is, randomly, I am getting a socket error # 0 error.  I never got this error with Delphi 2007 and Indy 10.2.3.  Any help would be GREATLY appreciated!  Thank you.

The code looks something like this:

var
	sHttpResult, sVar, sParam: string;
        ssHttpResult : TStringStream;
	slPostData : TStringList;
begin
        IdSSL.CheckForDisconnect(False);
        IDHttp.CheckForGracefulDisconnect(False);
        IdSSL.ReadTimeout := 30000;
        application.ProcessMessages;
        slPostData:= TStringList.Create;
        ssHttpResult := TStringStream.Create;
        {assign values to slPostData here...}
        IdHttp.Post(aHttpRequestData.sURL, slPostData, ssHttpResult);
0
James
4/14/2009 7:59:04 PM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

5 Replies
1037 Views

Similar Articles

[PageSpeed] 53

<James Nagle> wrote in message news:104296@forums.codegear.com...

> The issue is, randomly, I am getting a socket error # 0 error.

Can you get a stack trace when it happens?

>        IdSSL.CheckForDisconnect(False);
>        IDHttp.CheckForGracefulDisconnect(False);

You should not be calling either of those directly.  Let TIdHTTP handle 
disconnects internally for you.

-- 
Remy Lebeau (TeamB)
0
Remy
4/14/2009 9:08:16 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> <James Nagle> wrote in message news:104296@forums.codegear.com...
> 
> > The issue is, randomly, I am getting a socket error # 0 error.
> 
> Can you get a stack trace when it happens?
> 
> >        IdSSL.CheckForDisconnect(False);
> >        IDHttp.CheckForGracefulDisconnect(False);
> 
> You should not be calling either of those directly.  Let TIdHTTP handle 
> disconnects internally for you.
> 
> -- 
> Remy Lebeau (TeamB)

Hey Remy thank for all your help on these forums and your hard work and Indy :)

Anyway, I removed the check for disconnect lines like you suggested and I am still having the socket error #0 problem.  It's a MAJOR issue for me currently :(  In a nutshell, I have an ISAPI.dll compiled in Delphi 2007 webbroker that accepts Hex encoded, AES encrypted data as parameters.  A lot of the time, these calls can get rather large.  It works sometimes, but more often then not, the socket error 0 is coming up with Delphi 2009 and Indy 10.5.5.  I am also using the openssl .dlls from Indy (openssl-0
.9.8k-i386-win32).  This same code base worked like a champ with Delphi 2007 and Indy 10.2.3.

Here is a quick call stack from the IDE.  If you need something more in depth, please point me towards instructions on how to get it to you and I surely can provide it.

:7528f328 kernel32.RaiseException + 0x59
IdStack.TIdStack.RaiseSocketError(0)
IdStack.TIdStack.CheckForSocketError(???,(...))
IdIOHandler.TIdIOHandler.ReadFromSource(False,0,False)
IdIOHandlerStack.TIdIOHandlerStack.Connected
IdTCPConnection.TIdTCPConnection.Connected
IdHTTP.TIdHTTPResponse.GetKeepAlive
IdHTTP.TIdCustomHTTP.DoRequest(???,'https://blahblah/ISAPI.dll',$2E0C3B0,???,???)
IdHTTP.TIdCustomHTTP.Post('https://blahblah/ISAPI.dll',$61FB70,$3A42138)
IdHTTP.TIdCustomHTTP.Post('https://blahblah/ISAPI.dll',???,$3A42138)
uHttp.HttpPost($17FD7C)
uRemoteDBTools.Query('Loading Role Security Rights...','757549694A7351763562677266306A446F534477507345486C456348786457576C5255567A6258432F6B336746694A62476739513361424F427A4958754A77324B6237646A4848396D74626A4343466159616271644B49695671726963325944724C485535695443583567707144467552755A5268313066354B4870686B7178444A4D31465A53616F397077756C3032466C57574C35674F6E33386A536F46774F784F5667326170534F76466C474739676F5373506D414D51767453737437366C442B57596139734E454576704F35566F747737566B71466977655079773D3D',True
,False,False,False)
uSecurity.LoadRoleSecurity('','100','App1')
App1.TfApp1.FormCreate($2DA4920)
Forms.TCustomForm.DoCreate
Forms.TCustomForm.AfterConstruction
System.@AfterConstruction($2DA4920)
Forms.TCustomForm.Create(???)
Forms.TApplication.CreateForm(???,(no value))
App1Proj.App1Proj
:752ee4a5 kernel32.BaseThreadInitThunk + 0xe
:773bcfed ntdll.RtlCreateUserProcess + 0x8c
:773bd1ff ntdll.RtlCreateProcessParameters + 0x4e

Thank you in advance.
0
James
4/19/2009 5:53:12 PM
> {quote:title=James Nagle wrote:}{quote}
> > {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> > <James Nagle> wrote in message news:104296@forums.codegear.com...
> > 
> > > The issue is, randomly, I am getting a socket error # 0 error.
> > 
> > Can you get a stack trace when it happens?
> > 
> > >        IdSSL.CheckForDisconnect(False);
> > >        IDHttp.CheckForGracefulDisconnect(False);
> > 
> > You should not be calling either of those directly.  Let TIdHTTP handle 
> > disconnects internally for you.
> > 
> > -- 
> > Remy Lebeau (TeamB)
> 
> Hey Remy thank for all your help on these forums and your hard work and Indy :)
> 
> Anyway, I removed the check for disconnect lines like you suggested and I am still having the socket error #0 problem.  It's a MAJOR issue for me currently :(  In a nutshell, I have an ISAPI.dll compiled in Delphi 2007 webbroker that accepts Hex encoded, AES encrypted data as parameters.  A lot of the time, these calls can get rather large.  It works sometimes, but more often then not, the socket error 0 is coming up with Delphi 2009 and Indy 10.5.5.  I am also using the openssl .dlls from Indy (openssl
-0.9.8k-i386-win32).  This same code base worked like a champ with Delphi 2007 and Indy 10.2.3.
> 
> Here is a quick call stack from the IDE.  If you need something more in depth, please point me towards instructions on how to get it to you and I surely can provide it.
> 
> :7528f328 kernel32.RaiseException + 0x59
> IdStack.TIdStack.RaiseSocketError(0)
> IdStack.TIdStack.CheckForSocketError(???,(...))
> IdIOHandler.TIdIOHandler.ReadFromSource(False,0,False)
> IdIOHandlerStack.TIdIOHandlerStack.Connected
> IdTCPConnection.TIdTCPConnection.Connected
> IdHTTP.TIdHTTPResponse.GetKeepAlive
> IdHTTP.TIdCustomHTTP.DoRequest(???,'https://blahblah/ISAPI.dll',$2E0C3B0,???,???)
> IdHTTP.TIdCustomHTTP.Post('https://blahblah/ISAPI.dll',$61FB70,$3A42138)
> IdHTTP.TIdCustomHTTP.Post('https://blahblah/ISAPI.dll',???,$3A42138)
> uHttp.HttpPost($17FD7C)
> uRemoteDBTools.Query('Loading Role Security Rights...','757549694A7351763562677266306A446F534477507345486C456348786457576C5255567A6258432F6B336746694A62476739513361424F427A4958754A77324B6237646A4848396D74626A4343466159616271644B49695671726963325944724C485535695443583567707144467552755A5268313066354B4870686B7178444A4D31465A53616F397077756C3032466C57574C35674F6E33386A536F46774F784F5667326170534F76466C474739676F5373506D414D51767453737437366C442B57596139734E454576704F35566F747737566B71466977655079773D3D',Tr
ue,False,False,False)
> uSecurity.LoadRoleSecurity('','100','App1')
> App1.TfApp1.FormCreate($2DA4920)
> Forms.TCustomForm.DoCreate
> Forms.TCustomForm.AfterConstruction
> System.@AfterConstruction($2DA4920)
> Forms.TCustomForm.Create(???)
> Forms.TApplication.CreateForm(???,(no value))
> App1Proj.App1Proj
> :752ee4a5 kernel32.BaseThreadInitThunk + 0xe
> :773bcfed ntdll.RtlCreateUserProcess + 0x8c
> :773bd1ff ntdll.RtlCreateProcessParameters + 0x4e
> 
> Thank you in advance.


I think I might have fixed it.  I was playing with all the options in IdHTTP and set the HTTPOptions [hoKeepOrigProtocol] and also entered in a bunch of information into the Request (TIdHTTPRequest) such as Connection close, etc.

So far the socket error #0 hasn't come back up yet.
0
James
4/19/2009 7:28:52 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> <James Nagle> wrote in message news:104296@forums.codegear.com...
> 
> > The issue is, randomly, I am getting a socket error # 0 error.
> 
> Can you get a stack trace when it happens?
> 
> >        IdSSL.CheckForDisconnect(False);
> >        IDHttp.CheckForGracefulDisconnect(False);
> 
> You should not be calling either of those directly.  Let TIdHTTP handle 
> disconnects internally for you.
> 
> -- 
> Remy Lebeau (TeamB)

Hello,

I am still receiving a socket error #0 with Delphi 2009 and Indy 10.5.5.  I have isolated the problem and it is happening when I call a Delphi 2007 webbroker CGI or ISAPI.dll that returns an empty response.content.

For example the CGI code does something like this:

      Response.Content= '';
      Response.SendResponse;

Using Delphi 2007 and Indy 10.2.3 (and earlier for that matter), Indy would not throw a socket error #0 and would read in and return a blank string.

Is this a bug in the new Indy that was not present in previous versions, or is this the new correct behavior?  

Thank you in advanced!
0
James
5/1/2009 4:26:00 AM
<James Nagle> wrote in message news:111631@forums.codegear.com...

> Is this a bug in the new Indy that was not present in previous versions,
> or is this the new correct behavior?

I can't answer that without seeing exactly what the CGI is sending back, and 
the actual call stack that leads up to the error.

-- 
Remy Lebeau (TeamB)
0
Remy
5/2/2009 7:39:25 AM
Reply:

Similar Artilces:

C++ Builder/Delphi 2009 and IndyTiburon 10.5.5 error
Hello, i installing the latest IndyTiburon package r3641. 1. There are a problem with the genarated header file /core/IdWinsock2.hpp when i will use the components: [BCC Error] IdWinsock2.hpp(88):E2040 [BCC Error] IdWinsock2.hpp(89):E2040 [BCC Error] IdWinsock2.hpp(90):E2040 [BCC Error] IdWinsock2.hpp(91):E2040 static const Word IPPORT_REGISTERED_MIN = 0x400; static const Word IPPORT_REGISTERED_MAX = 0xbfff; static const Word IPPORT_DYNAMIC_MIN = 0xc000; static const Word IPPORT_DYNAMIC_MAX = 0xffff; I comment them out ! and it work fine ! But can i get any other Problem...

Delphi 5 To Delphi 2009
I upgraded to Delphi 2009 from D5. The install says I can install Delphi and/or C++. Delphi installed OK but I see nothing of C++. What am I missing or does my upgrade not include C++? Thanks It depends on what you bought. If you bought Delphi 2009 only, that's what you get. If you bought Delphi 2009 and C++ Builder 2009 you get both. My guess is you got Delphi 2009 only. The simplest way to verify is look your invoice - it should say I would think. You could also go to members.embarcadero.com, login, then click on my registered products. There will be a textual description of...

List::MoreUtils-0.25_1 pass on 5.10.1RC0, 5.10.0, 5.8.9, 5.8.8
Following up on my report that List::MoreUtils-0.24 failed its tests on the "maint-5.10 snapshot (aka 'RC0')" that came out on July, and Tassilo later confirming the nature of the problem ... List::MoreUtils-0.25_1 was just released on CPAN, and I have tested it manually from a download of the tarball from search.cpan.org, and the problem appears to be fixed. A clean unpack/Makefile/make/make-test passes all tests on 4 versions of Perl on my same PPCG4/MacOSX10.5.7 machine: - 5.10.1RC0 built by me with defaults, custom install loc - 5.10.0 built by m...

Upgrading to Delphi 2009 from Delphi 5
I've decided it's time to upgrade to Delphi 2009 Professional from my current Delphi 5 Professional which (according to the FAQ) makes me eligible for the upgrade pricing. However, I'd just like to clarify how this process works. My concern is that my Delphi 5 is not registered on the CodeGear site and this doesn't seem to be possible as far as I can tell. When installing the trial I noticed that Delphi 2009 registers itself with your CodeGear account so does this mean that the previous version must be registered there to verify you own a Professional edition? I plan to o...

perl-5.10.0-4 -> perl-5.10.0-5 site_perl update needed
2008/7/9 Reini Urban: > 2008/7/9 Reini Urban: >> 2008/7/8 Reini Urban: >>> 2008/7/8 Gary R. Van Sickle: >>>> Hi Reini, >>>> >>>> It looks like something changed between perl 5.10.0-4 and -5 which breaks >>>> the DateTime module from CPAN (version 0.4302, latest). The attached Simple >>>> Test Case(tm) results in only the following errors: >>>> >>>> Use of uninitialized value $id in pattern match (m//) at >>>> /usr/lib/perl5/site_perl/5.10/DateTime/Locale.pm line 65. &g...

Delphi and 5.5
Hello! I work with Delphi5 and SQL Anywhere 5.5 for DBMS-applications developing. There are 2 questions. 1. For desktop application. I'd like to include necessary files of SQL Anywhere into distribution to make installation procedure most simpler for user. Which files of SQL Anywhere should I put into installational package and also which additions should I make in Windows registry? 2. How can I register DB alias in ODBC? 3. The same for CS-application. Is it possible at all? TIA I believe all your questions about SQL Anywhere can be answered by reading the on-...

Problem with Delphi 3.0 and SQL Anywhere 5.5.0.3
Hi All ! I have next problem: I have programm writing in Delphi 3.0 and SQL Anywhere server 5.0.3 build #1666 is runnig under Intranetware 4.11 for small buisnes. The client station run with programm on Delphi 3.0, get the Error "Error ! Trying to acsses the page beyond the maximum allowspace ....." or someting like this. The mate is that it's the error with DB Space.(I think so) I think may be it the error in programm but may be in sever. When I shut down server and then restart it - it OK. This error is apearence once a week. What i have to do ? Please help...

problems with Sybase ASE 12.5.4 on Solaris 5.10 x86-64 architecture and Oracle 10.2.0.3.0 on Solaris 5.10 x86-64 architecture
Hello, My problem is that on the Oracle's side I can't make any connection with my Sybase server. The Sybase, on another side, doesn't have any solution that we can take to solve this problem (except the ECDA that haves a lot o problem) Any idea how can find on link or something to make on connection between these two databases? Thanks, Sergio what is your specific problem with ECDA? <Sergio> wrote in message news:4b683d8d.7586.1681692777@sybase.com... > Hello, > > My problem is that on the Oracle's side I can't make any > conne...

Smoke [5.10.0] maint-5.10-1169-ga0ab88b FAIL(XF) netbsd 5.0 (i386/1 cpu)
Automated smoke report for 5.10.0 patch a0ab88bb2bd59be4e0b0733f8f9f8557e373aed1 maint-5.10-1169-ga0ab88b p5netbsd: Intel 686-class (i386/1 cpu) on netbsd - 5.0 using cc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120) smoketime 5 hours 11 minutes (average 38 minutes 58 seconds) Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl), t ...

Smoke [5.10.0] maint-5.10-1220-gd0f0947 FAIL(XF) netbsd 5.0 (i386/1 cpu)
Automated smoke report for 5.10.0 patch d0f09470a55cd54ec20843bfdb3ba974a83bd6bb maint-5.10-1220-gd0f0947 p5netbsd: Intel 686-class (i386/1 cpu) on netbsd - 5.0 using cc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120) smoketime 5 hours 15 minutes (average 39 minutes 25 seconds) Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl), t ...

Smoke [5.10.0] maint-5.10-1141-g2700d9b FAIL(XF) netbsd 5.0 (i386/1 cpu)
Automated smoke report for 5.10.0 patch 2700d9b0bf253b12ed6a4ccf931fa4705edf2315 maint-5.10-1141-g2700d9b p5netbsd: AMD 686-class (i386/1 cpu) on netbsd - 5.0 using cc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120) smoketime 22 hours 1 minute (average 2 hours 45 minutes) Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl), t = make...

Smoke [5.10.0] maint-5.10-1171-ga2d4e51 FAIL(XF) netbsd 5.0 (i386/1 cpu)
Automated smoke report for 5.10.0 patch a2d4e51092c9dc1403a07e3cc313045aa0fabe63 maint-5.10-1171-ga2d4e51 p5netbsd: Intel 686-class (i386/1 cpu) on netbsd - 5.0 using cc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120) smoketime 5 hours 13 minutes (average 39 minutes 10 seconds) Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl), t ...

Smoke [5.10.0] maint-5.10-1462-g178839f FAIL(XF) netbsd 5.0 (i386/1 cpu)
Automated smoke report for 5.10.0 patch 178839f6222a37fcd169f62b4380083881cc6083 maint-5.10-1462-g178839f p5netbsd: Intel 686-class (i386/1 cpu) on netbsd - 5.0 using cc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120) smoketime 5 hours 13 minutes (average 39 minutes 10 seconds) Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl), t ...

Smoke [5.10.0] maint-5.10-1156-g45957f2 FAIL(XF) netbsd 5.0 (i386/1 cpu)
Automated smoke report for 5.10.0 patch 45957f2ee9816a6647753f1d918f837b83e9bf04 maint-5.10-1156-g45957f2 p5netbsd.refcnt.homeunix.org: Intel 686-class (i386/1 cpu) on netbsd - 5.0 using cc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120) smoketime 5 hours 12 minutes (average 39 minutes 5 seconds) Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (...

Smoke [5.10.0] maint-5.10-1342-gc09d26c FAIL(M) netbsd 5.0 (i386/1 cpu)
Automated smoke report for 5.10.0 patch c09d26c405f109be79e3487f71a3b134d4f9bc04 maint-5.10-1342-gc09d26c p5netbsd: Intel 686-class (i386/1 cpu) on netbsd - 5.0 using cc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120) smoketime 15 minutes 46 seconds (average 1 minute 58.250 seconds) Summary: FAIL(M) O = OK F = Failure(s), extended report at the bottom X = Failure(s) under TEST but not under harness ? = still running or test results not (yet) available Build failures during: - = unknown or N/A c = Configure, m = make, M = make (after miniperl)...

Web resources about - Delphi 2009 - Indy 10.5.5, IDHttp with SLL randomly getting socket error #0 - embarcadero.delphi.winsock

Are Facebook Accounts Being Randomly Disabled?
Are Facebook Accounts Being Randomly Disabled?

Michell Smith's answer to Steve Jobs: What are the best stories about people randomly meeting Steve Jobs ...
Michell Smith's answer: Prior to his return to Apple, it was obvious that the company was in trouble. Larry Ellison had floated the idea of a ...

Lucky - Randomly Exchange Photos with Friends on the App Store on iTunes
Get Lucky - Randomly Exchange Photos with Friends on the App Store. See screenshots and ratings, and read customer reviews.

cats randomly on december 17 - Flickr - Photo Sharing!
Just cat litter bags attacked by our kittens

Minecraft Command Block : Randomly Generated Forest - YouTube
In this video, I demonstrate what can be done by using the spreadplayers command. Keep in mind, this is just a proof of concept, and hopefully ...

Man randomly slashes stranger's throat with machete, before attacking taxi driver
Bravery of bystanders prevented machete deaths in Belconnen last night, prosecutors say.

Prison cells should be randomly swept for drugs after lockdown, Tracy-Lee Brannigan inquest finds
Prison cells in NSW should be subjected to random searches after the daily afternoon lockdown, particularly when inmates are suspected of illicit ...

Suncor Drug Testing: Oil Giant Loses Another Bid To Randomly Test Workers
FORT MCMURRAY, Alta. - Oilsands giant Suncor Energy has lost another battle in its attempt to randomly test thousands of union workers in northern ...

Show Your Valentine How Much You Care With a Randomly Chosen Facebook Gift
Valentine’s Day. It’s that time of year when the relationship-bound all scramble to do something special for their significant other — be it ...

Choir randomly discovers beautiful acoustics at zoo’s Reptile House
From the YouTube page: The choir from Harding University in Arkansas came to visit the Cincinnati Zoo. A few of them wandered into the Reptile ...

Resources last updated: 1/16/2016 3:19:59 AM