Board index » delphi » Problem with client locking up system using Indy

Problem with client locking up system using Indy

I have a Client that connects with the Server and processes information sent
from the server.  Everything works great to this point.  The user clicks on
a button on the client app and it creates and displays a Modal form.  As
Soon as this form is displayed the client stops processing any messages from
the server and the client has to be terminated.  Am I doing something wrong
here?  why does the client stop processing messages.

Thanks,
Rodger

 

Re:Problem with client locking up system using Indy


Rodger,

you ned to give somemore information -some code showing where the issue is
occuring etc - the question is to vague.

/A.

"Rodger Van Kirk" <rodg...@calsense.com> wrote in message
news:3b018b6b$1_2@dnews...

Quote
> I have a Client that connects with the Server and processes information
sent
> from the server.  Everything works great to this point.  The user clicks
on
> a button on the client app and it creates and displays a Modal form.  As
> Soon as this form is displayed the client stops processing any messages
from
> the server and the client has to be terminated.  Am I doing something
wrong
> here?  why does the client stop processing messages.

> Thanks,
> Rodger

Re:Problem with client locking up system using Indy


Ok here is what is going on.  My client App connects to the server and the
server sends some information back to the client and the client takes this
information and displays in in a TMemo.  The client then starts a TTimer
with an interval of 500 and keeps checking for data from the server.
Similar to the Chat demo.  If the user click on a button on the client app
the following code gets executed:

            Modal := TfrmIASelection.Create( Self );
            try
               with Modal do
               begin
                  cbxSelection.Visible := True;
                  edtFlowRate.Visible := False;
                  cbxSelection.Items.Clear;
                  for j := 1 to StrToInt( lblStationCount.Caption ) do
                  begin
                     if StationInUseTable.StationData[j] = 1 then
                        cbxSelection.Items.Add( IntToStr( j ) );
                  end;
                  cbxSelection.ItemIndex := Station;
                  lblTop.Caption := 'Select a station to Test';
                  lblMiddle.Caption := '';
                  lblBottom.Caption := '';
                  ActiveControl := cbxSelection;
                  if ( ShowModal = mrOK ) then                       <--
Client App Locks up here
                  begin
                     Station := StrToInt( cbxSelection.Text ) - 1;
                     Option := StrToInt( cbxSelection.Text );
                  end;
               end;
            finally
               Modal.Free;
            end;

As soon as the ShowModal gets executed the client app hangs.  The only way
to unstick it is to set the server app to Active := False the client then
detects the server disconnected and the client app is no longer hung.  Does
this help?

Thanks in advance,

Rodger

"Allen - Team Indy" <aoneillSPAMMKIL...@ipa.net> wrote in message
news:3b01ca26_2@dnews...

Quote
> Rodger,

> you ned to give somemore information -some code showing where the issue is
> occuring etc - the question is to vague.

> /A.

> "Rodger Van Kirk" <rodg...@calsense.com> wrote in message
> news:3b018b6b$1_2@dnews...
> > I have a Client that connects with the Server and processes information
> sent
> > from the server.  Everything works great to this point.  The user clicks
> on
> > a button on the client app and it creates and displays a Modal form.  As
> > Soon as this form is displayed the client stops processing any messages
> from
> > the server and the client has to be terminated.  Am I doing something
> wrong
> > here?  why does the client stop processing messages.

> > Thanks,
> > Rodger

Re:Problem with client locking up system using Indy


Do you need more information?

Rodger

"Rodger Van Kirk" <rodg...@calsense.com> wrote in message
news:3b055506_2@dnews...

Quote
> Ok here is what is going on.  My client App connects to the server and the
> server sends some information back to the client and the client takes this
> information and displays in in a TMemo.  The client then starts a TTimer
> with an interval of 500 and keeps checking for data from the server.
> Similar to the Chat demo.  If the user click on a button on the client app
> the following code gets executed:

>             Modal := TfrmIASelection.Create( Self );
>             try
>                with Modal do
>                begin
>                   cbxSelection.Visible := True;
>                   edtFlowRate.Visible := False;
>                   cbxSelection.Items.Clear;
>                   for j := 1 to StrToInt( lblStationCount.Caption ) do
>                   begin
>                      if StationInUseTable.StationData[j] = 1 then
>                         cbxSelection.Items.Add( IntToStr( j ) );
>                   end;
>                   cbxSelection.ItemIndex := Station;
>                   lblTop.Caption := 'Select a station to Test';
>                   lblMiddle.Caption := '';
>                   lblBottom.Caption := '';
>                   ActiveControl := cbxSelection;
>                   if ( ShowModal = mrOK ) then                       <--
> Client App Locks up here
>                   begin
>                      Station := StrToInt( cbxSelection.Text ) - 1;
>                      Option := StrToInt( cbxSelection.Text );
>                   end;
>                end;
>             finally
>                Modal.Free;
>             end;

> As soon as the ShowModal gets executed the client app hangs.  The only way
> to unstick it is to set the server app to Active := False the client then
> detects the server disconnected and the client app is no longer hung.
Does
> this help?

> Thanks in advance,

> Rodger

> "Allen - Team Indy" <aoneillSPAMMKIL...@ipa.net> wrote in message
> news:3b01ca26_2@dnews...
> > Rodger,

> > you ned to give somemore information -some code showing where the issue
is
> > occuring etc - the question is to vague.

> > /A.

> > "Rodger Van Kirk" <rodg...@calsense.com> wrote in message
> > news:3b018b6b$1_2@dnews...
> > > I have a Client that connects with the Server and processes
information
> > sent
> > > from the server.  Everything works great to this point.  The user
clicks
> > on
> > > a button on the client app and it creates and displays a Modal form.
As
> > > Soon as this form is displayed the client stops processing any
messages
> > from
> > > the server and the client has to be terminated.  Am I doing something
> > wrong
> > > here?  why does the client stop processing messages.

> > > Thanks,
> > > Rodger

Re:Problem with client locking up system using Indy


Perhaps im missingsomething but I dont see where you are handling if you
DONT get an mrOK result ... construct like this:

var
    x : TForm1
begin

x:= TForm1.create(TheOwnerForm);
x.ShowModal;
if x.ModalResult = mrOk then DoSomething
else DoSomeThingElse;
FreAndNil(x);

/A.

"Rodger Van Kirk" <rodg...@calsense.com> wrote in message
news:3b0ae5d1_2@dnews...

Quote
> Do you need more information?

> Rodger

Re:Problem with client locking up system using Indy


ShowModal returns the value to which the ModalResult property is set when it
closes the form.

"Allen - Team Indy" <aoneillSPAMMKIL...@ipa.net> wrote in message
news:3b0c56e3$1_1@dnews...

Quote
> Perhaps im missingsomething but I dont see where you are handling if you
> DONT get an mrOK result ... construct like this:

> var
>     x : TForm1
> begin

> x:= TForm1.create(TheOwnerForm);
> x.ShowModal;
> if x.ModalResult = mrOk then DoSomething
> else DoSomeThingElse;
> FreAndNil(x);

> /A.

> "Rodger Van Kirk" <rodg...@calsense.com> wrote in message
> news:3b0ae5d1_2@dnews...
> > Do you need more information?

> > Rodger

Other Threads