🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
9 messages
9 total messages Started by EV14 Mon, 14 May 2007 20:24
Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1105
Author: EV14
Date: Mon, 14 May 2007 20:24
20 lines
1828 bytes
Hello, I'm experiencing a weird problem :
* situation :
    - on a new alone form, I put a TClientSocket and a TServerSocket 
components
    - I set for one or the other the Active property to true

* weird symptoms :
    - if I check "Integrated Debugger" in the options, at run time I get 
a ESocketError exception 'impossible to create new socket'.

    - if I do not validate the use of Integrated Debugger, the 
application works fine (bigger applications work fine so) but it's at 
the cost of debugging possibility!

* more weird thing : I installed BCB on my portable computer and ... it 
works fine even with the debugger ! (but it's not powerfull enough for 
me to developp on this computer).

Please help, at this point my big appl needs me to reactivate the 
debugger (a nasty bug to find in lots of code lines).
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1106
Author: EV14
Date: Mon, 14 May 2007 20:30
1 lines
1128 bytes
Humm, it's a new discussion thread
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1107
Author: Remy Lebeau (TeamB)
Date: Mon, 14 May 2007 21:33
11 lines
1204 bytes
"EV14" <evuq1@bigfoot.com> wrote in message
news:4648c4b4@newsgroups.borland.com...

> Hello, I'm experiencing a weird problem :

Which version of BCB are you using?  ESocketError exeptions usually
include the original socket error code.  What is the full message?


Gambit
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1108
Author: EV14
Date: Tue, 15 May 2007 04:52
29 lines
2194 bytes
Remy Lebeau (TeamB) wrote:
> "EV14" <evuq1@bigfoot.com> wrote in message
> news:4648c4b4@newsgroups.borland.com...
> 
> 
>>Hello, I'm experiencing a weird problem :
> 
> 
> Which version of BCB are you using?  ESocketError exeptions usually
> include the original socket error code.  What is the full message?
> 
> 
> Gambit
> 
> 
> 
I use BC++Builder 6 update 4

The only code I can get is C0000008 by modifying debugger options :
- normal printing : "Le projet TestDebugger.exe a provoqu� une classe 
d'exception ESocketError avec le message 'Impossible de cr�er le nouveau 
socket'. Processus stopp�. Utilisez Pas-�-pas ou Ex�cuter pour continuer"
- modified options : "Le projet TestDebugger.exe a provoqu� une classe 
d'exception C0000008 avec le message 'exception d'application d�finie 
(code 0xC0000008) � 0x7c91eb74'. Processus stopp�. Utilisez Pas-�-pas ou 
Ex�cuter pour continuer"

But remember that it works when no debugger is active. I don't 
understand where the debugger can prevent the sockets to be created...
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1109
Author: EV14
Date: Tue, 15 May 2007 08:15
46 lines
2815 bytes
Humm, I'm realising that I misunderstood something about sockets : it 
seems that I don't prepare my sockets in the correct way before using 
them, but I don't know exactly what's wrong with them...

For ex, I want a SeverSocket managing port say 7890 and a ClientSocket 
connecting locally to it.
- on the ServerSocket1 component, I prepare Port=7890
- on the ClientSocket1 component, I prepare Address=127.0.0.1 and Port=7890.

I put the components on a fresh form with Active property to false and 
following code:

__fastcall TForm1::TForm1(TComponent* Owner)
         : TForm(Owner)
{
	ServerSocket1->Active=true ;
	ClientSocket1->Active=true ;
	ShowMessage( "1ere passe termin�e") ;
	ServerSocket1->Active=false ;
	ClientSocket1->Active=false ;
	ShowMessage( "2eme passe termin�e") ;
	ClientSocket1->Active=true ;
	ServerSocket1->Active=true ;
	ShowMessage( "3eme passe termin�e") ;
	exit(0) ;
}

* with Integrated Debugger activated, I get during execution :
{
	ServerSocket1->Active=true ;   --> throws an exception (the one I don't 
understand and mistakenly thought to be a interaction)
	ClientSocket1->Active=true ;
	ShowMessage( "1ere passe termin�e") ;
	ServerSocket1->Active=false ;
	ClientSocket1->Active=false ;
	ShowMessage( "2eme passe termin�e") ;
	ClientSocket1->Active=true ;
	ServerSocket1->Active=true ;
	ShowMessage( "3eme passe termin�e") ;
	exit(0) ;
}

* without Integrated Debugger activated, I get a smooth execution 
without any exception !

Please, what's wrong with my components preparation ?
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1110
Author: Remy Lebeau (TeamB)
Date: Tue, 15 May 2007 09:04
10 lines
1220 bytes
"EV14" <evuq1@bigfoot.com> wrote in message
news:46493bc1$1@newsgroups.borland.com...

> The only code I can get is C0000008

That an an Invalid Handle error, not a socket error.


Gambit
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1111
Author: Remy Lebeau (TeamB)
Date: Tue, 15 May 2007 09:06
15 lines
1337 bytes
"EV14" <evuq1@bigfoot.com> wrote in message
news:46496b68@newsgroups.borland.com...

> exit(0) ;

You should never use exit() in a VCL project.  It does not allow the
VCL to clean up after itself correctly.

> Please, what's wrong with my components preparation ?

Nothing.


Gambit
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1112
Author: EV14
Date: Tue, 15 May 2007 10:42
73 lines
3671 bytes
First of all, I want to thank you for your patience and your availability.

Remy Lebeau (TeamB) wrote:
 > "EV14" <evuq1@bigfoot.com> wrote in message
 > news:46493bc1$1@newsgroups.borland.com...
 >
 >
 >>The only code I can get is C0000008
 >
 >
 > That an an Invalid Handle error, not a socket error.
 >
 >
 > Gambit
 >
 >

Well, I agree but the message corresponding to this code is :
"Le projet TestDebugger.exe a provoqu� une classe d'exception 
ESocketError avec le message 'Impossible de cr�er le nouveau socket'.
Processus stopp�. Utilisez Pas-�-pas ou Ex�cuter pour continuer"

(The project produced a class exception ...with message 'impossible to 
create new socket' ...).

I suppose it means that during the Socket activation something goes 
wrong and an invalid handler (for a socket mecanism?) is produced.

Remy Lebeau (TeamB) wrote:

> "EV14" <evuq1@bigfoot.com> wrote in message
> news:46496b68@newsgroups.borland.com...
> 
> 
>>exit(0) ;
> 
> 
> You should never use exit() in a VCL project.  It does not allow the
> VCL to clean up after itself correctly.
> 

Noted, I'll be carefull by now, using Application->Terminate() method 
instead.

> 
>>Please, what's wrong with my components preparation ?
> 
> 
> Nothing.
> 
> 
> Gambit
> 
> 

If nothing goes wrong, why do I receive this "Le projet TestDebugger.exe 
a provoqu� une classe d'exception ESocketError avec le message 
'Impossible de cr�er le nouveau socket'. Processus stopp�. Utilisez 
Pas-�-pas ou Ex�cuter pour continuer" ?
Is it a warning , can I avoid this ?

In fact after few hours of research, I managed to avoid the message and 
the Method exit which occured after it by configuring debugger SE 
Exceptions 0xC0000008 (incorrect handle) as 'managed by user programm' 
and 'g�r�es � la reprise (managed at resume??)'.

The key thing is that, now, the method which contains the 
"Socket->Active=true ;" line is no more interrupted, and I can normally 
execute and debug my appl.

But I'm not totally satisfied not being able to understand what 
condition produces the alert (especially when this alert doesn't occur 
with the same project on my portable).
Re: Interaction between Integrated Debugger & TClientSocket or TServerSocket
#1115
Author: Remy Lebeau (TeamB)
Date: Tue, 15 May 2007 18:59
26 lines
2253 bytes
"EV14" <evuq1@bigfoot.com> wrote in message
news:46498df2@newsgroups.borland.com...

> Well, I agree but the message corresponding to this code is :
> "Le projet TestDebugger.exe a provoqu� une classe d'exception
> ESocketError avec le message 'Impossible de cr�er le nouveau
> socket'. Processus stopp�. Utilisez Pas-�-pas ou Ex�cuter pour
> continuer"

An ESocketError exception and an 0xC0000008 exception are two
completely different and unrelated errors.  I would expect an
ESocketError to be thrown if there were a true socket error.  You can
use WSAGetLastError() to find out why it fails.  But your error
message for the 0xC0000008 exception says nothing at all about
anything socket-related.  So I think you are chasing the wrong thing
when that error occurs.

> I suppose it means that during the Socket activation something goes
> wrong and an invalid handler (for a socket mecanism?) is produced.

There is no Handle of any kind involved when creating a socket.
0xC0000008 has nothing to do with the socket creation itself.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads