Communication Component - waiting for respond if service is down

AstiniaAstinia Member Posts: 40
Hello everyone.

I'm trying to understand where my problem is. Most of the time the code is working just fine, but sometimes it is waiting to be respond for a long-long time.
Sometimes the service, from which I'm waiting a respond is crushed. Is there any way to find out, that it crushed and don't wait for it?

Is there any lines (except SendWaitForReply(600000); and SLEEP(100);) that code from going on?
I've found such a function ReceiveTimeout in IMSMQBusAdapter Interface - if I put there any value - will it prevent form hanging?


CREATE(CC2);

CREATE(SBA);

CC2.AddBusAdapter(SBA,1);

OutMsg:= CC2.CreateoutMessage('Sockets://' + ... + ':' + ...);

OutStream := OutMsg.GetStream();
MessageBlob.Blob.CREATEINSTREAM(XMLStream);
COPYSTREAM(OutStream,XMLStream);

ReplyMsg := OutMsg.SendWaitForReply(600000);

IF NOT ISSERVICETIER THEN
ReplyStream := ReplyMsg.GetStream()
ELSE BEGIN
i := 0;
REPEAT
ReplyStream := ReplyMsg.GetStream();

IF ReplyStream.EOS THEN
Timeout := TRUE
ELSE BEGIN
SLEEP(100);
i += 1;
IF i = 100 THEN
Timeout := TRUE;
END;
UNTIL Timeout;
END;

Answers

  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • arcrexarcrex Member Posts: 3
    Hello, quite old, but i have similar problem and can not solve it out....
    Is it possible to manage it that "SendWaitForReply(10000)" will not crash with error
    after timeout ?
    I need to do some code when timeout passes, not to throw that error and stop.

    Thank you.
Sign In or Register to comment.