Compiled for compatibility with iOS.

This commit is contained in:
mottadelli75@gmail.com 2013-05-10 16:00:10 +00:00
parent 5f0b12b98f
commit ffcb2214e3
2 changed files with 17 additions and 6 deletions

View File

@ -4,7 +4,8 @@
//
// Contributors:
// Daniel Gaspary: dgaspary@gmail.com
// Oliver Marr: oliver.sn@wmarr.de
// Oliver Marr: oliver.sn@wmarr.de
// Marco Mottadelli: mottadelli75@gmail.com
// WebSite: www.danieleteti.it
// email:d.teti@bittime.it
// *******************************************************
@ -123,7 +124,7 @@ const
uses
Windows,
// Windows, // Remove windows unit for compiling on ios
IdGlobal,
Character;
{$ENDIF}
@ -467,9 +468,11 @@ function TStompClient.Receive(ATimeout: Integer): IStompFrame;
sb: TStringBuilder;
tout: boolean;
FirstValidChar: boolean;
UTF8Encoding: TEncoding;
// UTF8Encoding: TEncoding;
UTF8Encoding: IIdTextEncoding;
begin
UTF8Encoding := TEncoding.UTF8;
// UTF8Encoding := TEncoding.UTF8;
UTF8Encoding := enUTF8;
tout := False;
Result := nil;
try
@ -573,7 +576,8 @@ begin
{$ELSE}
// FTCP.IOHandler.write(TEncoding.ASCII.GetBytes(AFrame.output));
if Assigned(FOnBeforeSendFrame) then FOnBeforeSendFrame(AFrame);
FTCP.IOHandler.write(TEncoding.UTF8.GetBytes(AFrame.output));
//FTCP.IOHandler.write(TEncoding.UTF8.GetBytes(AFrame.output));
FTCP.IOHandler.write(IndyTextEncoding_UTF8.GetBytes(AFrame.output));
if Assigned(FOnAfterSendFrame) then FOnAfterSendFrame(AFrame);
{$ENDIF}
end;

View File

@ -75,7 +75,14 @@ procedure TSendMessageMainForm.Send;
begin
StompClient.Connect;
try
StompClient.Send(QueueEdit.Text,QueueMemo.Lines.Text);
try
StompClient.Send(QueueEdit.Text,QueueMemo.Lines.Text);
except
on e: exception do
begin
LogMemo.Lines.Add('ERROR: '+e.Message);
end;
end;
finally
StompClient.Disconnect;
end;