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.

Ian Proudfoot
Legend
February 22, 2018

Concerning timeout - you may also get this under special conditions:

  • My script FMdict.jsx consists of these functions:
    • Introduction​: SwitchUILanguage (); ShowDictInfo (); SetUpMenus();
    • Functions Command(), GetIniValue(), SetUpMenus(), ShowDictInfo(), SwitchUILanguage ()
  • Note that an inner function (ShowDictInfo) is called before the script has set up a menu. This is to give the user a note just at the start FrameMaker, even before the appearance of the Welcome screen.

If the user does not react in due time to the Alert message of this function (click OK to dismiss the message) then I get the Timeout message when clicking the OK button:

Error in C:\Users\Klaus\AppData\Roaming\Adobe\FrameMaker\14\startup\FMdict.jsx
Line 63: alert (localize (text, currentPrj, currentDir), localize (title), false);
Timeout


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