Skip to main content
Known Participant
February 22, 2018
Question

Timeout caused by loops

  • February 22, 2018
  • 1 reply
  • 566 views

Hello guys, its me again.


While trying to fix the startup problems, I encountered a completely new bug.
My script runs perfectly when started in ExtendScript Toolkit. I am using infinite loops for socket operations, which can be broken under certain conditions (e.g. wrong request params etc.)

I am receiving following error when my script is being started from FM:

The line mentioned above always varies - I repeat: the script runs well when being started in ExtendScript Toolkit.

I guess that the troublemaker are my infinite loops, but unfortunately I need them just the way they are.

How can I tell FM to disable this timeout?

Thanks thanks thanks.

Selim

This topic has been closed for replies.

1 reply

Ian Proudfoot
Legend
February 22, 2018

Hi Selim,

Would you post the script please?

Ian

selimc777Author
Known Participant
February 22, 2018

...

outer:

while(BOUNDARY_END_FOUND == false){

if(SOCKET_DEAD == true){

Primary_Socket = new Socket();

if(Primary_Socket.listen(PORT) == true){

log("#Restarted. Server listening to Port: " + PORT);

}//if

Primary_Socket.encoding = "UTF-8";

//Primary_Socket.timeout = 15;

SOCKET_DEAD = false;

}//if

else if(SOCKET_DEAD == false){

Poll_Socket = Primary_Socket.poll();

inner:

while (Poll_Socket != null) { // <-------- AT THIS POINT THE SCRIPT FAILED IN THE SCREENSHOT

//Poll_Socket.timeout = 15;

log ("\nConnection from " + Primary_Socket.host);

log("Date: " + Date());

Poll_Socket.encoding = "UTF-8";

var counter = 1;

//strLine = Poll_Socket.readln();

var strLine = Poll_Socket.readln();

while(strLine.indexOf(BOUNDARY_END) == -1){ //while2

if(SOCKET_DEAD == true || Poll_Socket == null){

break inner;

}

...


The marked place in the code is the loop waiting for an incoming connection in order to poll the socket.

But as I mentioned before, the script fails always on different points of the code when run directly by FM.

selimc777Author
Known Participant
February 26, 2018

Yes I have seen this too. It is possible to select Delay load clients in Preferences > Global > Launch. This can be used to ensure that the script does not run until FrameMaker has finished its start-up procedures.

Ian


Hello Ian,

I have tested your suggestion, but the problem is not solved. I still get a Timeout Error when I run my while loops. Is there any possible way to turn off this FrameMaker Timeout?