Hi guys Some more info on this:
It seems that in Indy 10 the Execute event automagically fires after the Connect event, which never used to happen in Indy 9, i.e. I want the execute to only fire after I have started sending data to it. Cheers Louis -------- Original Message -------- Subject: Upgrade to Indy 10 Date: Mon, 16 May 2005 21:39:36 +0200 From: Louis Young <[EMAIL PROTECTED]> To: Delphi-en <[email protected]>, CTDUG <[EMAIL PROTECTED]> Hi guys With regards to problems I was having previously with Indy 9, I've decided to upgrade to Indy 10, but this has introduced a whole host of new problems. This is a procedure called from the execute method and this is what it looks like in Indy 9: procedure TdmConnection.WaitForMessage; var sBuffer : string; iMessageLen : SmallInt; ssMessage : TStringStream; begin ssMessage := TStringStream.Create(''); try iMessageLen := AThread.Connection.ReadSmallInt; if iMessageLen > 2048 then raise Exception.Create('Message Length Exceeds 2048 bytes'); AThread.Connection.ReadStream(ssMessage, iMessageLen); sBuffer := Chr(Hi(iMessageLen)) + Chr(Lo(iMessageLen)) + ssMessage.DataString; if Form1.ckShowRawPackets.Checked then reLog.WriteLn(clRed, StringToAscii(sBuffer)); // Place the received packet into the ISOMessage for decomposition ISOMessage.Clear; ISOMessage.UseIPHeader := True; ISOMessage.Packet := sBuffer; Form1.LogBin(' Request = ', ISOMessage.Packet, AThread); LogMessageToFile('I', ISOMessage); finally ssMessage.Free; end; end; Now to accommodate the change to Indy 10, the procedure now looks as follows: procedure TdmConnection.WaitForMessage; var sBuffer : string; iMessageLen : SmallInt; ssMessage : TIdStreamVCL; ssMessageStream : TStringStream; begin ssMessageStream := TStringStream.Create(''); ssMessage := TIdStreamVCL.Create(ssMessageStream); try iMessageLen := AThread.Connection.IOHandler.ReadSmallInt; if iMessageLen > 2048 then raise Exception.Create('Message Length Exceeds 2048 bytes'); AThread.Connection.IOHandler.ReadStream(ssMessage, iMessageLen); sBuffer := Chr(Hi(iMessageLen)) + Chr(Lo(iMessageLen)) + ssMessageStream.DataString; if Form1.ckShowRawPackets.Checked then reLog.WriteLn(clRed, StringToAscii(sBuffer)); // Place the received packet into the ISOMessage for decomposition ISOMessage.Clear; ISOMessage.UseIPHeader := True; ISOMessage.Packet := sBuffer; Form1.LogBin(' Request = ', ISOMessage.Packet, AThread); LogMessageToFile('I', ISOMessage); finally ssMessage.Free; end; end; The problem is that iMessageLen is getting a value of 0 after AThread.Connection.IOHandler.ReadSmallInt. Is there a different way that this needs to be done in Indy 10? I'm busy going through the Indy 10 documentation now, but I haven't found anything useful. Any ideas? Cheers Louis ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

