首页 > 解决方案 > Livecode - 使客户端在丢失连接时自动重新连接

问题描述

我的服务器上运行了一个小程序来控制一些功能。我想要做的是创建一个移动应用程序,以便在客户端/服务器模式下控制该程序。我不能做的是在断开连接的情况下处理客户端的自动重新连接。

有什么建议吗?

提前非常感谢。

标签: serverclientlivecode

解决方案


我不知道这是否真的适合你,但这是 LiveCode 开发人员通常检查活动套接字的方式之一:

on checkSocks theSocket
  if theSocket is among the lines of the openSockets then
    send "checkSocks theSocket" to me in 5 secs
  else
    beep
    answer error "Socket" && theSock && "is unavailable."
  end if
end checkSocks

使用要检查的套接字作为参数调用此命令。


推荐阅读