Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: TIdTCPClient Problem

www.cryer.info
Managed Newsgroup Archive

Re: TIdTCPClient Problem

Subject:Re: TIdTCPClient Problem
Posted by:"FALvarado" (f.alvara..@brainsoftwaredotnet)
Date:Sat, 26 Jan 2008 08:40:53

Remy:

> What do you mean exactly? The application just dies?  Is an exception
> reported to you?
No exception, no message; it just silently dies. when I log messages to
a file the application "freezes" and the log file remains locked until I
   kill (ctrl-alt-del) the application. When I'm not using the log file
it just closes. An extract of the log file follows:

1/25/2008   3:37:39 PM   ABC   Write GetNxtStat
#1{"Order",8,"GetNextStation";"Id",3,830488;"H.Identifier",8,"4000004206";"H.LineNo",3,24;"H.GetAddData",3,0;}
1/25/2008   3:37:41 PM   ABC   read GetNxtStat
#1{"Order",8,"OrdeState";"Id",3,830488;"H.OrderState",3,0;"H.OrderErrorText",8,"";"H.NextStatNo",3,90;"H.NextStatIdx",3,1;"H.NextFuNo",3,1;"H.NextWorkPos",3,1;"H.TypeNo",8,"0285004100";"H.TypeVar",8,"0001";"H.Charge",8,"G0000";"H.WorkingCode",3,0;"H.PartState",3,5;"H.ResFileName",8,"";"H.Result",3,1;"H.NioBits",3,0;"H.OrderId",8,"";}

1/25/2008   3:37:42 PM   ABC   Write SetPrtRec
<?xml version="1.0" encoding="UTF-8" ?><root><header version="1.0"
eventId="655589" eventName="partReceived" eventSwitch="-1"><location
lineNo="24" statNo="90" statIdx="1" fuNo="1" workPos="1" toolPos="1"
processName="PACKING" application="PLC"/></header><event><partReceived
identifier="1"/></event><body><items><item name="typeNo"
value="F00HJ00433" dataType="8" /></items></body></root>
1/25/2008   3:37:44 PM   ABC   Read SetPrtRec
*********** <<<<< In second cycle it fails here >>>>>>>>>> ************
<?xml version="1.0" encoding="utf-8" standalone="yes"?><root><header
eventId="655589" eventName="partReceived" version="1.0" eventSwitch="-1"
timeStamp="2008-01-25T15:37:44.5687675-07:00"><location lineNo="24"
statNo="90" statIdx="1" fuNo="1" workPos="1" toolPos="1"
application="PLC" processName="PACKING" /></header><event><result
returnCode="0"></result></event><body><items><item name="BoxId"
value="V1000" dataType="8" /><item name="typeNo" value="" dataType="8"
/></items></body></root>
1/25/2008   3:37:44 PM   ABC   write SetPrtRec
<?xml version="1.0" encoding="UTF-8" ?><root><header version="1.0"
eventId="305776" eventName="partReceived" eventSwitch="0"> <location
lineNo="24" statNo="90" statIdx="1" fuNo="1" workPos="1" toolPos="1"
processName="PACKING" application="PLC"/></header><event><partReceived
identifier="1"/></event><body><items><item name="typeNo"
value="F00HJ00433" dataType="8" /></items></body></root>
1/25/2008   3:37:46 PM   ABC   Read SetPrtRec
<?xml version="1.0" encoding="utf-8" standalone="yes"?><root><header
eventId="305776" eventName="partReceived" version="1.0" eventSwitch="0"
  timeStamp="2008-01-25T15:37:47.0219553-07:00"><location lineNo="24"
statNo="90" statIdx="1" fuNo="1" workPos="1" toolPos="1"
application="PLC" processName="PACKING" /></header><event><result
returnCode="0"></result></event><body><items><item name="PalletId"
value="T1000" dataType="8" /><item name="typeNo" value="" dataType="8"
/></items></body></root>

1/25/2008   3:37:47 PM   ABC   Write PartProcs
<?xml version="1.0" encoding="UTF-8"?><root><header version="1.0"
eventId="868845" eventName="partProcessed"><location lineNo="24"
statNo="90" statIdx="1" fuNo="1" workPos="1" toolPos="1"
processName="PACKING" application="PLC"/></header><event><partProcessed
identifier="4000004206"/></event><body><resHead result="1"
typeNo="F00HJ00433" typeVar="" typeVersion="" charge="" workingCode="5"
nioBits="0" workCycleCount="0"/><items><item name="BoxNumber"
value="B02581000" dataType="8" /><item name="typeNo" value=""
dataType="8"/><item name="PalletNumber" value="M02581000" dataType="8"
/><item name="typeNo" value="" dataType="8"/><item name="Destination"
value="EMPTY" dataType="8"/></items></body></root>
1/25/2008   3:37:48 PM   ABC   Write PartProcs
<?xml version="1.0" encoding="utf-8" standalone="yes"?><root><header
eventId="868845" eventName="partProcessed" version="1.0"
eventSwitch="-1" timeStamp="2008-01-25T15:37:47.4438411-07:00"><location
lineNo="24" statNo="90" statIdx="1" fuNo="1" workPos="1" toolPos="1"
application="PLC" processName="PACKING" /></header><event><result
returnCode="0"></result></event><body /></root>

1/25/2008   3:37:49 PM   ABC   Write MvPart2Stck
#1{"order",8,"MovePartToStock";"Id",3,83;"H.Identifier",8,"4000004206";"H.StockIdentifier",8,"4000004206";"H.LineNo",3,"24";"H.StatNo",3,"90";"H.StatIdx",3,"1";"H.FuNo",3,"1";"H.WorkPos",3,"1";}
1/25/2008   3:37:51 PM   ABC   read MvPart2Stck
Order",8,"OrderState";"Id",3,83;"H.OrderState",3,0;"H.OrderErrorText",8,"";}


> What applet are you referring to?
it's just a small external application to which I give the string
already  formated to be transmitted using the same code as in main
application. It works fine all times. My  guess is that maybe it fails
because of the  speed of the operation (?) I mean, the formated string
is fine (I can open it in IE), it works fine one full cycle, but in the
second cycle it fails!

> You really should be using a true XML engine for that, such as Delphi's
> TXMLDocument component, or any number of available third-party XML
> libraries.
I know and I will do it as soon as I fix this problem

> This code looks very familiar.  Didn't you post this same code awhile back?
> Why are you still doing all of that manually instead of just using
> TIdTCPClient's WriteInteger() and Write() methods instead, like was
> suggested earlier?
I did it, but then I was trying to "translate" an VB6 application that
is doing the same operations and working fine.

I appreciate your efforts trying to help me...

Francisco

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive