如何防止<会话断开>运行 Intersystems Cach 时出错 终端脚本?

发布于 2024-07-06 10:50:33 字数 423 浏览 10 评论 0原文

我正在开发一个需要执行系统间缓存终端脚本的系统。

当我在常规 Caché 终端或 telnet 终端内运行例程时,Cache 会毫无问题地执行例程直至结束。 但是,当我尝试运行相同的例程,但这次在 Caché 终端脚本中调用例程时,Caché 会在一段时间后断开会话。 文档中根本没有提及“超时”设置或与我收到的“”消息相关的任何内容。

该脚本的运行方式如下:

Cterm.exe /console=cn_iptcp:192.168.2.13[23] c:\test.s

1) 有谁知道是什么导致 Interystems Caché 在运行过程中断开会话连接(会话也不是空闲的。它定期向控制台输出状态消息)?

2)有什么解决办法吗?

谢谢,

路易斯·费尔南多

I'm developing a system that needs to execute Intersystems Cache Terminal Scripts.

When I run a routine inside the regular Caché terminal or a telnet terminal, Cache executes the routine until the end with no problems. But when I try to run the same routine, but this time calling the routine within a Caché terminal Script, Caché disconnects the session after a while. There is no mention at all in the documentation of a "timeout" setting or anything realted to the "" messages i'm getting.

The script is run just like this:

Cterm.exe /console=cn_iptcp:192.168.2.13[23] c:\test.s

1) Does anybody know what may be causing Interystems Caché to disconnected the session in the middle of the run (the session isn't idle either. It regularly outputs status messages to the console)?

2) Any ideas of how to solve it?

Thanks,

Luís Fernando

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

顾挽 2024-07-13 10:50:33

过了一会儿,我终于发现了会话被终止的原因。 您必须在最后等待某些内容,否则脚本就会终止。 但您必须确保您正在等待的字符串在代码完成之前不会被打印。

因此,我只是将程序更改为仅在最后打印“操作完成”,然后添加以下行:

 waitfor "Operation finished"
terminate

现在程序不会被中断。

干杯,

路易斯

After a while I finally discovered why the session was being terminated. You must wait for something at the end or the script just terminates. But you must be sure that the string you are waiting for is not something that will be printed until the code finishes.

So, I've just changed the program to print "Operation finished" only at the end, and then put the line:

 waitfor "Operation finished"
terminate

Now the program doesn't get interrupted.

Cheers,

Luís

思慕 2024-07-13 10:50:33

有没有可能不是超时,而是其他问题? 可能是未捕获/记录的运行时错误?

从交互式控制台运行与作为脚本运行之间的主要区别在于,当您以交互方式运行时,您处于程序员模式,但在脚本中您处于用户模式。 我无法立即想到为什么这很重要,但可能您的代码对此很敏感。

这里有一些可以尝试的事情:编写一个非常简单的脚本,除了时不时地写出一个字符之外,什么也不做。 也许是这样的:

FI = 1:1:360 H 10 W“。” ;每 10 秒写一个点,持续 1 小时

如果这也超时,那么您就知道这是终端的问题,而不是您的代码的问题。

Is there a chance it's not a timeout, but some other problem? Possibly a runtime error that's not being trapped/logged?

The main difference between running from the interactive console and as a script is that when you run interactively you're in Programmer Mode, but in the script you're in User Mode. I can't think of any reason off-hand why that would matter, but possibly your code is sensitive to that.

Here's something to try: Write a very simple script that does nothing except write out a character every now and then. Maybe something like this:

F I=1:1:360 H 10 W "." ;Write a dot every 10 seconds for 1 hour

If that gets the timeout too then you know it's the terminal, not your code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文