• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Timeout caused by loops

Community Beginner ,
Feb 22, 2018 Feb 22, 2018

Copy link to clipboard

Copied

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:

errorFM.png

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

TOPICS
Scripting

Views

336

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 22, 2018 Feb 22, 2018

Copy link to clipboard

Copied

Hi Selim,

Would you post the script please?

Ian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 22, 2018 Feb 22, 2018

Copy link to clipboard

Copied

...

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2018 Feb 22, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 22, 2018 Feb 22, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 26, 2018 Feb 26, 2018

Copy link to clipboard

Copied

LATEST

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines