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:
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
Copy link to clipboard
Copied
Hi Selim,
Would you post the script please?
Ian
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.
Copy link to clipboard
Copied
Concerning timeout - you may also get this under special conditions:
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
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
Copy link to clipboard
Copied
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?