Problem with ACK response

Discussion of open issues, suggestions and bugs regarding to (known as Delphi HL7) HL7 Components
Post Reply
miguito
Posts: 12
Joined: Thu Apr 05, 2012 4:44 pm

Problem with ACK response

Post by miguito »

When I receive the message ORM, return an ACK (TCP Indy). Sending a batch of messages (ten) done correctly the first 5 and the sixth broke my connection (Connection Closed Gracefully).

Can it be to have trial components installed yet?

I post the code is the event of idTCPServer OnExecute.

Code: Select all

procedure TForm4.IdTCPServer1Execute(AContext: TIdContext);
var
  Bloques: integer;
  i: integer;
  TamanoBloque: integer;
  trozoTexto: ansistring;
  texto: ansistring;
  ack: TdiACK_25;
begin

  TamanoBloque := 1024;

  // Receive
  Bloques := StrToInt(AContext.Connection.IOHandler.ReadLn);
  texto := '';
  for i := 0 to Bloques do
    texto := texto + AContext.Connection.IOHandler.ReadLn;
  texto := MimeDecodeString(texto);
  //Result := texto;
  memo1.lines.add(texto);

  // Send
  ack := TdiACK_25.Create;
  try
    ////////////////////////////
    texto := ack.AsXML;    // I GET ERROR HERE (with "ack.AsString" Too)
    ////////////////////////////
    texto := MimeEncodeStringNoCRLF(texto);
    Bloques := Length(texto) div TamanoBloque;
    AContext.Connection.IOHandler.writeln(IntToStr(Bloques));
    for i := 0 to Bloques do
    begin
      trozoTexto := ansistrings.AnsiMidStr(texto, (TamanoBloque * i) + 1, TamanoBloque);
      AContext.Connection.IOHandler.writeln(trozoTexto);
    end;
  finally
    freeandnil(ack);
  end;
end;
A greeting
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Problem with ACK response

Post by admin »

Hi,
Trial version is a limited 10 message per day.
Exception message is : 'Trial limit has been reached.'
What is your exception message ?

Best regards.
miguito
Posts: 12
Joined: Thu Apr 05, 2012 4:44 pm

Re: Problem with ACK response

Post by miguito »

I had hidden the exceptions of Delphi (Notity on language exceptions)
and see "Connection Closed Gracefully." But is caused
by "Trial Has Been limit reached".

Ok. Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests