Delphi XE2, Indy 10 - sending string using streams [Edit]

Dear folks

The following code is supposed to send a text string to a client that is listening on a set port and ip address. The connection works fine.

The problem is that nothing seems to be sent.

{code}
function TFCSelectForm.SendNitroMessage(NitroRequest: String): String;
var
  sStrm: TMemoryStream;
begin
  try
     sStrm := TMemoryStream.Create;
     try
        sStrm.WriteBuffer(Pointer(NitroRequest)^,Length(NitroRequest));
        // sStrm shows as () in the debugger
        IdTCPClient1.IOHandler.Write(sStrm, 0, False);
        sStrm.Position := 0;
     finally
        sStrm.Free;
     end;
  except
     DpsTimer.Enabled := False;
     Label1.Caption := 'Paymark is offline.';
  end;
end;

NitroRequest certainly has data in it.  But it appears to "disappear" when it is added to the stream.  In that the sStrm shows as '()' when I check it using the debugger.

I'm blowed if I can see what I'm doing wrong.

Just one other thing - when I check the Position value it shows as 13.  Which is the length of the string that is supposed to be sent.  So there must be something there?

Thanks

Alan

Edited by: Alan Jeffery on Aug 21, 2013 6:54 PM

Edited by: Alan Jeffery on Aug 21, 2013 7:10 PM
0
Alan
8/22/2013 2:11:22 AM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

8 Replies
1988 Views

Similar Articles

[PageSpeed] 19

Alan wrote:

> sStrm.WriteBuffer(Pointer(NitroRequest)^,Length(NitroRequest));

In XE2, Delphi's String type is Unicode, but your code is assuming it is 
Ansi instead (WriteBuffer() operates on bytes, not characters).  If your 
receiver can receive Unicode, then do this instead:

{code:delphi}
sStrm.WriteBuffer(Pointer(NitroRequest)^, Length(NitroRequest) * SizeOf(Char));
{code}

However, if your receiver is expecting Ansi instead (which is most likely), 
then you need to convert the Unicode data to Ansi.  You can either:

1) change your NitroRequest parameter to an AnsiString and let the RTL handle 
the conversion for you when you pass a Unicode string to your function:

{code:delphi}
function TFCSelectForm.SendNitroMessage(NitroRequest: AnsiString): String;
{code}

2) use a TStringStream instead of a TMemoryStream, and let the RTL convert 
the Unicode string to bytes for you:

{code:delphi}
function TFCSelectForm.SendNitroMessage(NitroRequest: String): String;
var
  sStrm: TStringStream;
begin
  try
    sStrm := TStringStream.Create(NitroRequest, TEncoding.Default); // or 
any TEncoding you want
    try
      IdTCPClient1.IOHandler.Write(sStrm, 0, False);
    finally
      sStrm.Free;
    end;
  except
    DpsTimer.Enabled := False;
    Label1.Caption := 'Paymark is offline.';
  end;
end;
{code}

3) use Indy's WriteStringToStream() function and let Indy convert the Unicode 
string to bytes for you:

{code:delphi}
function TFCSelectForm.SendNitroMessage(NitroRequest: String): String;
var
  sStrm: TMemoryStream;
begin
  try
    sStrm := TMemoryStream.Create;
    try
      WriteStringToStream(sStrm, NitroRequest, TIdTextEncoding.Default); 
// or any TIdTextEncoding you want
      IdTCPClient1.IOHandler.Write(sStrm, 0, False);
    finally
      sStrm.Free;
    end;
  except
    DpsTimer.Enabled := False;
    Label1.Caption := 'Paymark is offline.';
  end;
end;
{code}

4) don't use a TStream at all.  The IOHandler can convert and write the Unicode 
string directly:

{code:delphi}
function TFCSelectForm.SendNitroMessage(NitroRequest: String): String;
begin
  try
    IdTCPClient1.IOHandler.Write(NitroRequest, TIdTextEncoding.Default); 
// or any TIdTextEncoding you want
  except
    DpsTimer.Enabled := False;
    Label1.Caption := 'Paymark is offline.';
  end;
end;
{code}

--
Remy Lebeau (TeamB)
0
Remy
8/22/2013 4:57:18 AM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> 4) don't use a TStream at all.  The IOHandler can convert and write the Unicode 
> string directly:
> 
> {code:delphi}
> function TFCSelectForm.SendNitroMessage(NitroRequest: String): String;
> begin
>   try
>     IdTCPClient1.IOHandler.Write(NitroRequest, TIdTextEncoding.Default); 
> // or any TIdTextEncoding you want
>   except
>     DpsTimer.Enabled := False;
>     Label1.Caption := 'Paymark is offline.';
>   end;
> end;
> {code}
> 
> --

Remy

Thanks for that.  It worked.  The problem now is that the response isn't what I expected:

Here is the code waiting for the response:

{code}
const
   cStart = '#';
var
   I : Integer;
   sStr : String;
begin
   sStr := '';
   Result := '';
   I := 0;
   try
      IdTCPClient1.IOHandler.WaitFor(cStart, True, False, Indy8BitEncoding,5000);
   except
      // DPSTimer.Enabled := False;
      Exit;
   end;
   repeat
      // I gets the value of 'S002' on the first respinse from the client, instead of '0060'
      I := StrToInt(IdTCPClient1.IOHandler.ReadString(4));
      IdTCPClient1.IOHandler.CheckForDisconnect(True, True);
      IdTCPClient1.IOHandler.CheckForDataOnSource(IdTimeoutDefault);
   until False;
   if I <> 0 then
   begin
      sStr := IdTCPClient1.IOHandler.ReadString(I, Indy8BitEncoding);
      if Length(sStr) <> 0 then
      begin
         // just in case the response differed - clear the buffer
         // not sure this is a good idea.
         //IdTCPClient1.IOHandler.DiscardAll;
         Result := sStr;
      end;
   end;
{code}


Here is the response - from a test application that came with the SDK;

[09:20:33:348]Send: #0013G0000000
[09:20:33:569]Recv: #0060S00220PROCESSING NOW                          000000000
[09:20:35:944]Recv: #0060S00220ACCEPTED                                000001006
[09:20:35:964]Recv: #00073L
[09:20:35:965]Send: #00073 

The ReadString(4) should get the '0060'.  Instead it's getting the 'S002'.  I don't understand why that could happen.  In practice the software doesn't need to do anything with the "PROCESSING NOW" and "ACCEPTED" responses.  It does need to respond to the following:

[09:20:36:066]Recv: #02273R*-----Training-----*
     In Training    
                    
TERMINAL    00901350
TIME     28FEB 20:58
TRAN 000019         
MERCHANT LOGON      
      ACCEPTED      
                    
*----Test Only-----*

[09:20:36:070]Send: #00073 

And then wait for the following:
[09:20:40:593]Recv: #0090G2100ACCEPTED            0090135010009013050    280270205831000019I5100 NITRO 0102000

That one says the process was successful.  I only need to deal with the stuff up to the end of 'ACCEPTED'.  But, as I said, I'm stymied with the ReadString(4) getting the wrong values.  I can't figure out how to work around that because it shouldn't happen.  As far as I can figure it.

Thanks

Alan



> Remy Lebeau (TeamB)

Edited by: Alan Jeffery on Aug 22, 2013 2:31 PM

Edited by: Alan Jeffery on Aug 22, 2013 2:32 PM

Edited by: Alan Jeffery on Aug 22, 2013 2:33 PM

Edited by: Alan Jeffery on Aug 22, 2013 2:34 PM
0
Alan
8/22/2013 9:35:54 PM
Alan wrote:

> I gets the value of 'S002' on the first respinse from the client, instead 
of '0060'

You have altered the code I gave you earlier.  You changed it to introduce 
an endless repeat loop that reads 4 bytes at a time until a socket disconnect/error 
occurs.  Why?  On the first iteration of the loop, it would read '0060', 
then the next iteration would read 'S002', then '20PR', then 'OCES', then 
'SING', then ' NOW', then ' 000', then '0000', then '00#0', and so on.  See 
the problem?

All you need to do is wait for the start, determine the length, read that 
many bytes.  Done.  Do not loop.  Do not call CheckForDisconnect().  Do not 
call CheckForDataOnSource().  Do not call DiscardAll().

Given the new samples you have shown, the first 4 bytes following the '#' 
are NOT consistently a message length (unless you are truncating the data 
you are logging - please don't do that!).  That is contradicting what you 
claimed earlier:

#0013G0000000

Message *is* 13 characters long...

#0060S00220PROCESSING NOW 000000000

Message *is not* 60 characters long!

#0060S00220ACCEPTED 000001006

Message *is not* 60 characters long!

#00073L

Message *is* 13 characters long...

#00073 

Message *is not* 7 characters long!

#02273R*-----Training-----*
In Training 
TERMINAL 00901350
TIME 28FEB 20:58
TRAN 000019 
MERCHANT LOGON 
ACCEPTED 

*----Test Only-----*

Message *is not* 227 characters long!

#00073 

Message *is not* 7 characters long!

#0090G2100ACCEPTED 0090135010009013050 280270205831000019I5100 NITRO 0102000

Message *is not* 90 characters long!

So now we are back to square one again - DISCOVERING THE TRUE FORMAT OF THE 
MESSAGES!!!  It should not be taking THIS LONG to find out what the actual 
format of the messages is, either from documentation or asking the vendor 
directly.

I did not receive any private message from you earlier, so please post the 
documentation to the Attachments forum.

--
Remy Lebeau (TeamB)
0
Remy
8/22/2013 10:22:33 PM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Alan wrote:
> 
> > I gets the value of 'S002' on the first respinse from the client, instead 
> of '0060'
> 
> You have altered the code I gave you earlier.  You changed it to introduce 
> an endless repeat loop that reads 4 bytes at a time until a socket disconnect/error 
> occurs.  Why?  On the first iteration of the loop, it would read '0060', 
> then the next iteration would read 'S002', then '20PR', then 'OCES', then 
> 'SING', then ' NOW', then ' 000', then '0000', then '00#0', and so on.  See 
> the problem?
>
Remy

I just spotted that.  And have removed the loop.  Still not working correctly.
 
> All you need to do is wait for the start, determine the length, read that 
> many bytes.  Done.  Do not loop.  Do not call CheckForDisconnect().  Do not 
> call CheckForDataOnSource().  Do not call DiscardAll().
> 
> Given the new samples you have shown, the first 4 bytes following the '#' 
> are NOT consistently a message length (unless you are truncating the data 
> you are logging - please don't do that!).  That is contradicting what you 
> claimed earlier:
> 
> #0013G0000000
> 
> Message *is* 13 characters long...
> 
> #0060S00220PROCESSING NOW 000000000
> 
> Message *is not* 60 characters long!
> 
> #0060S00220ACCEPTED 000001006
> 
> Message *is not* 60 characters long!
> 
> #00073L
> 
> Message *is* 13 characters long...
> 
> #00073 
> 
> Message *is not* 7 characters long!
> 
> #02273R*-----Training-----*
> In Training 
> TERMINAL 00901350
> TIME 28FEB 20:58
> TRAN 000019 
> MERCHANT LOGON 
> ACCEPTED 
> 
> *----Test Only-----*
> 
> Message *is not* 227 characters long!
> 
> #00073 
> 
> Message *is not* 7 characters long!
> 
> #0090G2100ACCEPTED 0090135010009013050 280270205831000019I5100 NITRO 0102000
> 
> Message *is not* 90 characters long!
> 
> So now we are back to square one again - DISCOVERING THE TRUE FORMAT OF THE 
> MESSAGES!!!  It should not be taking THIS LONG to find out what the actual 
> format of the messages is, either from documentation or asking the vendor 
> directly.
> 
Gack.  Sorry about that.  The cutnpaste did truncate.  I didn't see it.  The responses are as long as the "length" field says.

I have been dealing directly with the vendor's developer's.  It's been like getting blood out of a stone.  And the documentation is wrong in certain places.  For example it doesn't mention those 'S' responses.  I have a more recent copy.  I'll attach that.

The problem I'm having now is that the 'S' responses are being dealt with but one response is simply getting the wrong string.  In fact it's getting the beginning of the next message.

The response is the #00073L message above.  Which I have to respond to with a #00073 message to trigger a receipt.  But the client isn't waiting for that. It's immediately giving me the final ACCEPTED message.  Although the 7 is being read correctly the ReadString is getting '3L#0090'.  If I try I - 4 the connection hangs - which isn't a surprise.

I can't find an "Attachments" forum.  Where is it?  Ok found it.  Thread created. With latest documentation.

It still doesn't show the format of display messages.  However the vendor's folks say those messages can be ignored.  Which is what I've set things up to do.  In that the procedure that works out what response is required ignores those messages with with 'S' in them.

Thanks

Alan

> I did not receive any private message from you earlier, so please post the 
> documentation to the Attachments forum.
> 
> --
> Remy Lebeau (TeamB)

Edited by: Alan Jeffery on Aug 22, 2013 4:56 PM

Edited by: Alan Jeffery on Aug 22, 2013 4:57 PM

Edited by: Alan Jeffery on Aug 22, 2013 4:57 PM

Edited by: Alan Jeffery on Aug 22, 2013 5:03 PM
0
Alan
8/23/2013 12:06:52 AM
Alan wrote:

> Gack.  Sorry about that.  The cutnpaste did truncate.  I didn't see
> it.  The responses are as long as the "length" field says.

OK, then that does match what is in the documentation (thanks for that), 
and the documentation does confirm that the length value includes the '#' 
and length fields, so calling ReadString(MsgLen-5) is the corrct way to go 
after calling ReadString(4) to get the message length.

> I have been dealing directly with the vendor's developer's.  It's been
> like getting blood out of a stone.  And the documentation is wrong in
> certain places.

That is fine, as long as the information about the message length is accurate. 
 That is the most important thing right now.

> For example it doesn't mention those 'S' responses.

Actually, it does.  They are Display events.  See section 3.12 of the documentation.

So, given this sequence:

[09:20:33:348]Send: #0013G0000000
[09:20:33:569]Recv: #0060S00220PROCESSING NOW 000000000
[09:20:35:944]Recv: #0060S00220ACCEPTED 000001006
[09:20:35:964]Recv: #00073L
[09:20:35:965]Send: #00073 

You requested a Logon (but I don't see a cooresponding response, unless you 
omitted it), then you received 2 Display events, then you received a Receipt 
event saying "Logon receipt about to be printed", which you then replied to.

And given this sequence:

[09:20:36:066]Recv: #02273R*-----Training-----*
In Training 
TERMINAL 00901350
TIME 28FEB 20:58
TRAN 000019 
MERCHANT LOGON 
ACCEPTED 

*----Test Only-----*

[09:20:36:070]Send: #00073 
[09:20:40:593]Recv: #0090G2100ACCEPTED 0090135010009013050 280270205831000019I5100 
NITRO 0102000

You received a Receipt event saying "Receipt present for POS to print" with 
additional data, which you replied to, and then you received a Logon response.

> The problem I'm having now is that the 'S' responses are being dealt
> with but one response is simply getting the wrong string.  In fact
> it's getting the beginning of the next message.
<snip>
> Although the 7 is being read correctly the ReadString is getting '3L#0090'.

That is because you are passing the full message length (7) to ReadString() 
instead of subtracting 5 for the bytes you have already read.  1 byte for 
the '#', 4 bytes for the length field.  That goes back to a comment in my 
earlier example:

{code:delphi}
Result := IdTCPClient1.IOHandler.ReadString(MsgLen-5, Indy8BitEncoding); 
// assuming the length value includes the starting '#' and 4 byte of the 
length...
{code}

Which the documentation confirms is true:

{quote}
Length of message **including start and length fields**
{quote}

> If I try I - 4 the connection hangs - which isn't a surprise.

Use I - 5 instead.

> It still doesn't show the format of display messages.

Yes, it does, in section 3.12.

[09:20:33:569]Recv: #0060S00220PROCESSING NOW 000000000

Breaks done to this (assuming your newsreader truncated white space when 
posting):

Start = '#'
Length  = '0060'
Command Code  = 'S'
SubCode  = '0'
Num Lines  = '02'
Line Length  = '20'
Text = 'PROCESSING NOW'
Cancel = '0'
Accept = '0'
Decline = '0'
Authorise = '0'
Input Data = '0'
OK = '0'
Reserved = '0'
Reserved = '0'
Graphic Code = '0'

And:

[09:20:35:944]Recv: #0060S00220ACCEPTED 000001006

Breaks done to this:

Start = '#'
Length  = '0060'
Command Code  = 'S'
SubCode  = '0'
Num Lines  = '02'
Line Length  = '20'
Text = 'ACCEPTED'
Cancel = '0'
Accept = '0'
Decline = '0'
Authorise = '0'
Input Data = '0'
OK = '1'
Reserved = '0'
Reserved = '0'
Graphic Code = '6'

--
Remy Lebeau (TeamB)
0
Remy
8/23/2013 1:16:55 AM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Alan wrote:
> 
> > Gack.  Sorry about that.  The cutnpaste did truncate.  I didn't see
> > it.  The responses are as long as the "length" field says.
> 
> OK, then that does match what is in the documentation (thanks for that), 
> and the documentation does confirm that the length value includes the '#' 
> and length fields, so calling ReadString(MsgLen-5) is the corrct way to go 
> after calling ReadString(4) to get the message length.
> 
> > I have been dealing directly with the vendor's developer's.  It's been
> > like getting blood out of a stone.  And the documentation is wrong in
> > certain places.
> 
> That is fine, as long as the information about the message length is accurate. 
>  That is the most important thing right now.
> 
> > For example it doesn't mention those 'S' responses.
> 
> Actually, it does.  They are Display events.  See section 3.12 of the documentation.

Yes, I see that.  The previous version didn't.  Didn't mention them, at all.
> 
> So, given this sequence:
> 
> [09:20:33:348]Send: #0013G0000000
> [09:20:33:569]Recv: #0060S00220PROCESSING NOW 000000000
> [09:20:35:944]Recv: #0060S00220ACCEPTED 000001006
> [09:20:35:964]Recv: #00073L
> [09:20:35:965]Send: #00073 
> 
> You requested a Logon (but I don't see a cooresponding response, unless you 
> omitted it), then you received 2 Display events, then you received a Receipt 
> event saying "Logon receipt about to be printed", which you then replied to.
> 
> And given this sequence:
> 
> [09:20:36:066]Recv: #02273R*-----Training-----*
> In Training 
> TERMINAL 00901350
> TIME 28FEB 20:58
> TRAN 000019 
> MERCHANT LOGON 
> ACCEPTED 
> 
> *----Test Only-----*
> 
> [09:20:36:070]Send: #00073 
> [09:20:40:593]Recv: #0090G2100ACCEPTED 0090135010009013050 280270205831000019I5100 
> NITRO 0102000
> 
> You received a Receipt event saying "Receipt present for POS to print" with 
> additional data, which you replied to, and then you received a Logon response.
> 
> > The problem I'm having now is that the 'S' responses are being dealt
> > with but one response is simply getting the wrong string.  In fact
> > it's getting the beginning of the next message.
> <snip>
> > Although the 7 is being read correctly the ReadString is getting '3L#0090'.
> 
> That is because you are passing the full message length (7) to ReadString() 
> instead of subtracting 5 for the bytes you have already read.  1 byte for 
> the '#', 4 bytes for the length field.  That goes back to a comment in my 
> earlier example:
> 
> {code:delphi}
> Result := IdTCPClient1.IOHandler.ReadString(MsgLen-5, Indy8BitEncoding); 
> // assuming the length value includes the starting '#' and 4 byte of the 
> length...
> {code}
> 
> Which the documentation confirms is true:
> 
> {quote}
> Length of message **including start and length fields**
> {quote}
> 
> > If I try I - 4 the connection hangs - which isn't a surprise.
> 
> Use I - 5 instead.

Yep, that fixed it.  Sometimes I wonder about my math.  I had forgotten the '#' had already gone.
> 
> > It still doesn't show the format of display messages.
> 
> Yes, it does, in section 3.12.
> 
> [09:20:33:569]Recv: #0060S00220PROCESSING NOW 000000000
> 
> Breaks done to this (assuming your newsreader truncated white space when 
> posting):
> 
> Start = '#'
> Length  = '0060'
> Command Code  = 'S'
> SubCode  = '0'
> Num Lines  = '02'
> Line Length  = '20'
> Text = 'PROCESSING NOW'
> Cancel = '0'
> Accept = '0'
> Decline = '0'
> Authorise = '0'
> Input Data = '0'
> OK = '0'
> Reserved = '0'
> Reserved = '0'
> Graphic Code = '0'
> 
> And:
> 
> [09:20:35:944]Recv: #0060S00220ACCEPTED 000001006
> 
> Breaks done to this:
> 
> Start = '#'
> Length  = '0060'
> Command Code  = 'S'
> SubCode  = '0'
> Num Lines  = '02'
> Line Length  = '20'
> Text = 'ACCEPTED'
> Cancel = '0'
> Accept = '0'
> Decline = '0'
> Authorise = '0'
> Input Data = '0'
> OK = '1'
> Reserved = '0'
> Reserved = '0'
> Graphic Code = '6'
> 
> --
Yes, that is correct.  As I said, the display messages can be ignored.  But I do need to trap the '3' messages and they require an acknowledgement as '#00073'.

Now I have another strange thing.  I'm sending a "Set dialog" message.  This configures the dialog form of the Nitro client.

It sends this message:   #00612500   0   Center      1Dialog Title  

And gets back this one:  #00082 1  just about immediately.

But the IOHandler.WaitFor is timing out.  I thought it was the data I was sending the client.  But it is correct.  

I disabled the timer when the '00' 'ACCEPTED' message was received.  And enabled it again when the Set Dialog message was sent.  Timeout is set at 5000 seeing as the responses from the Nitro client can be kind of slow.

Alan
> Remy Lebeau (TeamB)
0
Alan
8/23/2013 2:12:59 AM
Alan wrote:

> It sends this message:   #00612500   0   Center      1Dialog Title
> 
> And gets back this one:  #00082 1  just about immediately.

So far so good.

> But the IOHandler.WaitFor is timing out.  I thought it was the data I
> was sending the client.  But it is correct.

That means either the '#' of the response is not appearing in the InputBuffer 
to begin with, or the reading of the previous message likely got it by accident. 
 Either way seems odd, assuming no other thread is reading from the same 
socket and thus grabbing data that your reading code is expecting.

--
Remy Lebeau (TeamB)
0
Remy
8/23/2013 6:11:50 PM
Alan wrote:

> It sends this message:   #00612500   0   Center      1Dialog Title
> 
> And gets back this one:  #00082 1  just about immediately.

So far so good.

> But the IOHandler.WaitFor is timing out.  I thought it was the data I
> was sending the client.  But it is correct.

That means either the '#' of the response is not appearing in the InputBuffer 
to begin with, or the reading of the previous message likely got it by accident. 
 Either way seems odd, assuming no other thread is reading from the same 
socket and thus grabbing data that your reading code is expecting.

--
Remy Lebeau (TeamB)
0
Remy
8/23/2013 6:55:24 PM
Reply:

Similar Artilces:

Converting Delphi 2007 Indy 10.2.3 to Delphi 2009 Indy 10.5.5 [Edit]
Hello, I am currently attempting to port over a Delphi 2007 project that uses Indy 10.2.3 (very successfully) to Delphi 2009 and Indy 10.5.5 (I just got the latest development build this morning). I think I am running into an encoding issue, but am not sure. Specifically, IDHTTP with SSL calls an old CGI and the CGI returns a .zip file and I then save it to the disk. In 2007 and before this worked perfectly. In 2009, it is not. Here is the examples of the 2 different results (though cut way short in the post) I am getting back: 2007: 'PK'#3#4#$14#0#0#0#8#0'rLQ9žrPb€'#0...

Delphi XE2 - Indy 10
Dear folks As result of security issues one of the email services in NZ has changed the settings of their email server. It used to be port 25 and outgoing mail was SMTP.xtra.co.nz. The port is now 465 and outgoing mail is now send.xtra.co.nz. The client configuration requires authentication and a secure connection (SSL). The result is that my code to connect for everyone using that provider is now "busted". I have changed the port and outgoing host accordingly. And have set the IOHandler of idSMTP as IdSSLIOHandlerSocketOpenSSL1. With the Authtype as satSASL. I have als...

How Can I Delphi 2009 & Indy 10 TCPServer & TCPClient & Stream ? [Edit]
How can i send simple XML data from TCPClient to TCPServer and opposite. The Indy Version is the Delphi 2009 shipped version (v10). I have some XML data (you can think it as TStrings). I Can not convert the xml string to stream and send it to server then can't convert from stream sent to server to TStrings (or string) again in server (or client) side... Thanks for code snippets & answers... Edited by: Huseyin Melih Kara on Apr 27, 2009 7:59 AM Edited by: Huseyin Melih Kara on Apr 28, 2009 5:24 AM > {quote:title=Huseyin Melih Kara wrote:}{quote} > How can i send simp...

Indy 10 Delphi XE2 confusion
I have just taken the plunge and updated from Delphi 5 to XE2. In D5 I have been happily using the ClientSocket and ServerSocket components to do some fairly basic TCP comms. I am now trying to understand how to do it using Indy 10. Unfortunately there seems to be very little in the way of examples and doco that is written for non gurus. Is there a huge demo folder somewhere that I have missed seeing? If I understand correctly there also seems to have been a change sometime during Indy 10 from Threads to Contexts. Most of the examples I have been able to find will not compile under XE2, even...

migrating from Delphi 6 With Indy 10 to XE7 with Indy 10
I updated the original Indy in D6 to version 10 several years ago. Now I want to migrate my application from D6 to XE7 and would like some feedback on the best route to take. I usually send data using readln and writeln statements. The data is typically XML format. Since migrating to XE7 will include potential unicode data what is the best approach to take when reading and writing data? Will writeln and readln work in these cases or should I be using a different strategy to send unicode data between the tidtcpclient and tidtcpserver applications? al wrote: > I usually send data ...

Indy 10 Delphi XE2 confusion
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_663cb.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Updated "Chat 2.0" demo for Indy 10 in XE2. -- Remy Lebeau (TeamB) --JivePart=_663cb.zeB8CwDOH5aMJzMl Content-Type: application/x-zip-compressed; name="Chat.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Chat.zip" UEsDBBQAAAAAAAyxjD8AAAAAAAAAAAAAAAAQAAAAQ2hhdCAyLjAvQ2xpZW50L1BLAwQUAAAA...

TIdTraceRoute indy delphi xe2 [Edit]
i need trace the route of an ip, actually i am using the TIdTraceRoute indy component from the idTraceRoute unit. (delphi xe2) IdTraceRoute1:= TIdTraceRoute.Create(Self); IdTraceRoute1.ResolveHostNames:= True; IdTraceRoute1.ReceiveTimeout:= 5000; IdTraceRoute1.OnReply:= TraceRoute; IdTraceRoute1.Host:= 'www.google.com';//OR 172.16.0.13 (INTRANET IP) IdTraceRoute1.Trace; procedure TForm1.TraceRoute(ASender: TComponent; const AReplyStatus: TReplyStatus); begin Memo1.Lines.Add(AReplyStatus.FromIpAddress); end; but always return. 0.0.0.0 0....

Access to legacy (Delphi 4) Midas server from Delphi XE2 [Edit]
Hello, My company biggest product is developped with Delphi 4 and uses several Midas servers. It's a really big application (still in evolution, since 1997) , that has been started with Delphi 3. A partial or complete rewrite of this application is planned in a mid term future, and I must study if we can envisage a soft migration of some parts of the software on Delphi XE2 (or XE4), or if a complete rewrite even of the servers parts is required. If a complete rewrite must be done, my boss doesn't exclude to study the possibility of using another development environment to rewri...

Debugging in Delphi XE2 using another Delphi BDS process as host
Hi I've been using delphi a long time And I always had the possibility of debbuging Packages using another Delphi process as host. This is very useful to test the design-time side of packages. Now with XE 2 I can whether running with options - Debugger - Host Application or Attach to process Any ideas? Thanks Plp Pedro wrote: > Now with XE 2 I can whether running with options - Debugger - Host > Application or Attach to process What exactly are you having trouble with? Error messages, unexpected behavior, etc. -- Remy Lebeau (TeamB) Hi Remy ...

Problem with printing, using Delphi XE2 [Edit]
I have problem with printing images using Delphi XE2. I have code Delphi 7, and this code work very well. {code} procedure Print; var ImgName: string; rect: TRect; jpg: TJPEGImage; begin OpenPictureDialog1.Execute; ImgName := OpenPictureDialog1.FileName; rect.TopLeft:=Point(0,0); rect.BottomRight:=Point(Printer.PageWidth,Printer.PageHeight); jpg := TJPEGImage.Create; jpg.LoadFromFile(ImgName); Printer.BeginDoc; Printer.Canvas.StretchDraw(rect,jpg); Printer.EndDoc; end; {code} But this code Delphi XE2 is not work, printer print clear sheets. (HP ...

Delphi 7 Indy 10 HTTPS [Edit]
I have an old program I inherited that I'm required to maintain and Delphi is not a language I regularly use. From what I can see, the program uses an http proxy server to monitor pages as they are loaded into a browser control. Depending on the name and/or the content of the pages, the http proxy server does various tasks. All has been good up until now. The client wishes to now use https for their pages and I was wondering how can I get the http proxy server to be able to deal with https pages and keep the client happy. I did try to add an IdSSLIOHandlerSocketOpenSSL to the program ...

Delphi 7 to Delphi XE2
Hi, Still using that old workhorse, Delphi7, but am going to the conference in London hosted by Embarcadero on Delphi XE2. Although I would like to "move with the times" and am keen to get the UNICODE and 64-bit support offered by the latest IDEs, I confess to being more than a little scared about all the UNICODE/String/AnsiString and 32/64 bit issues I'm probably going to fall over. Anyone recently upgraded from Delphi7 to one of the latest Delphi IDEs? Thanks, Alain On 03/02/2012 08:55, Alain Dekker wrote: > Still using that old workhorse, Delphi7, but...

Indy 10: multicasting in Windows and MAC with Delphi XE2
Hi everyone, I am trying the new version of Delphi, XE2. I want to make a mDNS client / server, so I have placed the components TIdIPMCastClient and TIdIPMCastServer, and configured them. Under Windows, I have been able to send packets using the TIdIPMCastServer, although they are not with the source port 5353 (the one for mDNS), because I get always the error "address already in use". How can I workaround this problem, so I can send multicast datagrams with source port 5353? But under MAC, I have alway the error "Socket error #22, invalid argument". I have tried two...

Using Delphi 6 updating Indy version [Edit]
I am using Delphi 6 with Indy. In this version the notify synch event appears to be broken. Is it possible to update to the latest version of Indy that matches what is included with XE7? If so, where can I find the actual update? FWIW: my current version is Indy 10.5.8.0 al wrote: > I am using Delphi 6 with Indy. In this version the notify synch event > appears to be broken. In what way? > Is it possible to update to the latest version of Indy that matches what > is included with XE7? Yes. > If so, where can I find the actual update? The same place you...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

Web resources about - Delphi XE2, Indy 10 - sending string using streams [Edit] - embarcadero.delphi.winsock

Sending/receiving relationship - Wikipedia, the free encyclopedia
A sending/receiving relationship is one in which a public school district sends some or all of its students to attend the schools of another ...

U.K. Woman Faces 20 Months For Creating Fake Facebook Accounts, Sending Herself Abusive Messages
A woman in Cornwall in the U.K. came up with a creative way to use Facebook to accelerate a family spat, and it earned her 20 months in prison. ...

CHVRCHES - Dear guys, Please stop sending us emails like... - Facebook
Dear guys, Please stop sending us emails like this. This is one of the more polite ones. Other recent classics include "I'm going to give her ...

Facebook Sending Perez Hilton More Traffic than Google, Driving 3.3% of All US Traffic to Video Sites ...
For media companies evaluating their Facebook marketing strategy , here’s an interesting sign of the times: web analytics firm Hitwise is reporting ...

A better experience for sending Tweets and DMs - Twitter Blog
... panel New Tweet panel in da...... Skip to main content Blog Got an account? Sign in Search form Search &nbsp A better experience for sending ...

How to Go From Working 60 Hours a Week to 40 By Sending 2 Emails a Week
I’m convinced 95% of cubicle workers who work over 60 hours a week constantly can cut it down to 40-45 hours by sending 2 emails a week to their ...

Live Emoji - sending GIF Animation Emoji for Zoosk,Skype,Kik,Whatsapp,Facebook Messenger Etc. on the ...
Get Live Emoji - sending GIF Animation Emoji for Zoosk,Skype,Kik,Whatsapp,Facebook Messenger Etc. on the App Store. See screenshots and ratings, ...


Cynthia McKinney - responds to Obama on sending troops into Afghanistan - Debate Answer - YouTube
Cynthia McKinney, Green Party Presidential candidate, responds to Barack Obama on his support for sending troops into Afghanistan. Based on his ...

Great-grandmother 'would die' before sending kids to Italy
Great-grandmother 'would die' before sending kids to Italy

Resources last updated: 12/23/2015 3:58:55 AM