 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
George K Guest
|
Posted: Mon Feb 09, 2004 7:42 am Post subject: URGENT! What's wrong with Indy? |
|
|
Hi,
I have an app that worked fine and works until today in many clients.
In two of my clients (it's not only one) I receive some strange exceptions.
Example, on TcpServer :
void __fastcall TfmMain::Server1Disconnect(TIdPeerThread *AThread)
{
AnsiString IP = AThread->Connection->Socket->Binding->PeerIP);
The last line produces an exception. And not only this line, all the socket
relative functions like this code:
TIdPeerThread *AThread;
TList *AList = Server1->ThreadMgr->ActiveThreads->LockList();
for (int i=0; i < AList->Count; i++) {
AThread = (TIdPeerThread *) AList->Items[i];
if (AThread->Connection->Socket->Binding->PeerIP == ToIP) {
AThread->Connection->WriteLn(Encrypt(Msg));
ThreadMgr->ActiveThreads->UnlockList();
return true;
}
}
Server1->ThreadMgr->ActiveThreads->UnlockList();
Error like this: Access violation at address 008361C8 in module
'server.exe'. Read of address 00000004.
Any idea please? Thank you
|
|
| Back to top |
|
 |
Steve Guest
|
Posted: Wed Feb 11, 2004 12:21 pm Post subject: Re: URGENT! What's wrong with Indy? |
|
|
Indy sends exceptions to let you know stuff has happened. They arent
nessecarily a bad thing. I think its a silly idea, but there isnt a way to
get rid of it.
"George K" <george (AT) nospam (DOT) org> wrote
| Quote: | Hi,
I have an app that worked fine and works until today in many clients.
In two of my clients (it's not only one) I receive some strange
exceptions.
Example, on TcpServer :
void __fastcall TfmMain::Server1Disconnect(TIdPeerThread *AThread)
{
AnsiString IP = AThread->Connection->Socket->Binding->PeerIP);
The last line produces an exception. And not only this line, all the
socket
relative functions like this code:
TIdPeerThread *AThread;
TList *AList = Server1->ThreadMgr->ActiveThreads->LockList();
for (int i=0; i < AList->Count; i++) {
AThread = (TIdPeerThread *) AList->Items[i];
if (AThread->Connection->Socket->Binding->PeerIP == ToIP) {
AThread->Connection->WriteLn(Encrypt(Msg));
ThreadMgr->ActiveThreads->UnlockList();
return true;
}
}
Server1->ThreadMgr->ActiveThreads->UnlockList();
Error like this: Access violation at address 008361C8 in module
'server.exe'. Read of address 00000004.
Any idea please? Thank you
|
|
|
| Back to top |
|
 |
George K Guest
|
Posted: Wed Feb 11, 2004 1:28 pm Post subject: Re: URGENT! What's wrong with Indy? |
|
|
You are out of topic.
Every time the exception is handled all connections are disconnected and the
software hangs.
Is it silly?
"Steve" <darkpho66 (AT) hotmail (DOT) com> wrote
| Quote: | Indy sends exceptions to let you know stuff has happened. They arent
nessecarily a bad thing. I think its a silly idea, but there isnt a way to
get rid of it.
"George K" <george (AT) nospam (DOT) org> wrote in message
news:402739f0 (AT) newsgroups (DOT) borland.com...
Hi,
I have an app that worked fine and works until today in many clients.
In two of my clients (it's not only one) I receive some strange
exceptions.
Example, on TcpServer :
void __fastcall TfmMain::Server1Disconnect(TIdPeerThread *AThread)
{
AnsiString IP = AThread->Connection->Socket->Binding->PeerIP);
The last line produces an exception. And not only this line, all the
socket
relative functions like this code:
TIdPeerThread *AThread;
TList *AList = Server1->ThreadMgr->ActiveThreads->LockList();
for (int i=0; i < AList->Count; i++) {
AThread = (TIdPeerThread *) AList->Items[i];
if (AThread->Connection->Socket->Binding->PeerIP == ToIP) {
AThread->Connection->WriteLn(Encrypt(Msg));
ThreadMgr->ActiveThreads->UnlockList();
return true;
}
}
Server1->ThreadMgr->ActiveThreads->UnlockList();
Error like this: Access violation at address 008361C8 in module
'server.exe'. Read of address 00000004.
Any idea please? Thank you
|
|
|
| Back to top |
|
 |
Steve Guest
|
Posted: Fri Feb 13, 2004 4:02 pm Post subject: Re: URGENT! What's wrong with Indy? |
|
|
Perhaps it isnt your problem, but you can get messages from Indy components,
when nothing is wrong.
|
|
| Back to top |
|
 |
Marco Caspers Guest
|
Posted: Thu Feb 19, 2004 12:21 am Post subject: Re: URGENT! What's wrong with Indy? |
|
|
Steve wrote:
| Quote: | Indy sends exceptions to let you know stuff has happened. They arent
nessecarily a bad thing.
|
That's correct.
| Quote: | I think its a silly idea,
|
That's just you not understanding what exceptions are.
| Quote: | but there isnt a way to get rid of it.
|
Sure there is: You write your own library.
[snip]
But you're completely disregarding what the original poster asked.
Exceptions have absolutely nothing to do with Access violations.
An access violation is a bug.
| Quote: | "George K" <george (AT) nospam (DOT) org> wrote in message
news:402739f0 (AT) newsgroups (DOT) borland.com...
|
| Quote: | Error like this: Access violation at address 008361C8 in module
'server.exe'. Read of address 00000004.
Any idea please? Thank you
|
Dunno what exactly 'return true' does in C/C++, but i expect it does
set the return value of the function to true and nothing more.
If it doesn't terminate the function on that spot, but continues
executing, the bug is that you unlock the thread list 2 times.
It will always bomb out on the 2nd time of course..
<<<<<<
|
|
| Back to top |
|
 |
Marco Caspers Guest
|
Posted: Thu Feb 19, 2004 12:25 am Post subject: Re: URGENT! What's wrong with Indy? |
|
|
George K wrote:
| Quote: | You are out of topic.
He's off topic yes. |
| Quote: | Every time the exception is handled all connections are disconnected
and the software hangs.
|
It's not an exception, it's an access violation quite a different beast.
Access violation has to do with system memory, it usually occurs when
you are trying to do something with an unassigned pointer to an object
or something in that line.
As i wrote in my other message, the problem is probably that you try to
unlock the locked list for the second time..
If you delete one (best would be to eliminate the nested one) then you
probably won't have the issue anymore..
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|