Quantcast
Channel: Atozed Forums - All Forums
Viewing all articles
Browse latest Browse all 277

Server chrashs

$
0
0
Hello

I have a Server in Indy, Application mode, with 9 Pages.

the ServerControllerBaseConfig looks like this:

Code:
void __fastcall TIWServerController::IWServerControllerBaseConfig(TObject *Sender)
{
  TmainForm::SetURL("/", "mainForm"); 
  TwakoForm::SetURL("/", "wakoForm"); 
  TadrForm::SetURL("/", "adrForm"); 
  TzahlForm::SetURL("/", "zahlForm"); 
  TpaypalForm::SetURL("/", "paypalForm");   
  TendeForm::SetURL("/", "endeForm"); 
  TbestellForm::SetURL("/", "bestellForm"); 
  TNexiForm::SetURL("/", "nexiForm"); 
  TnexiErrForm::SetURL("/", "nexiErrForm"); 

  RegisterContentType(L"application/json");   


  ...
}

and in mainform-create is the alloc of these pages like:


Code:
void setAsMainForm() {
  TmainForm::SetAsMainForm();
}
#pragma startup setAsMainForm


void __fastcall TmainForm::IWAppFormCreate(TObject *Sender)
{
try {
        wakoForm = new TwakoForm(this);
        adrForm  = new TadrForm(this);
        bestellForm = new TbestellForm(this);
        zahlForm = new TzahlForm(this);
        endeForm = new TendeForm(this);
        paypalForm  = new TpaypalForm(this);
        nexiForm  = new TNexiForm(this);
        nexiErrForm  = new TnexiErrForm(this);
    }
catch(Exception &ex)
    {
      CreErrTxt = "Exception creating Forms : " + ex.Message;
      isCreErr = true;
    }
...



if (isCreErr)
 throw Exception(CreErrTxt)

most times , it works.
but if an error occurs, I throw an exception to end this session.
This may happen, if something goes wrong in wakoForm-&tCreate or other constructor calls.

If I throw a Exception like described, these Session dies and thats ok.
But now, other sessions can no longer get created. Every new one comes with an access violation when created by "new" .

I can't find out, why
I solved it by notice the exception but throwing it in onShow, instead of onCreate. Now it works.

I looked for hours to find a reason, but it seems , that an Exception in mainForm.create prevent the server from creating new sessions .

CBuider 10.2.3   IW 15.6.7




greetings from germany
  jörg

Viewing all articles
Browse latest Browse all 277

Trending Articles