server - Livecode - 使客户端在丢失连接时自动重新连接
问题描述
我的服务器上运行了一个小程序来控制一些功能。我想要做的是创建一个移动应用程序,以便在客户端/服务器模式下控制该程序。我不能做的是在断开连接的情况下处理客户端的自动重新连接。
有什么建议吗?
提前非常感谢。
解决方案
我不知道这是否真的适合你,但这是 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
使用要检查的套接字作为参数调用此命令。
推荐阅读
- typescript - 运行 tsc 命令什么都不做,忽略 tsconfig 文件?
- html - 访问组件内的 innerText
- python - Python Tkinter Frame - 使框架宽度跨越整个根窗口宽度
- html - Angular 应用程序视图中的 bootstrap 4 元素定位
- php - 了解使用 PHP SDK 为网站 Facebook 提要生成访问令牌
- java - 如何修复我的代码以打印“AAADADDA”而不是“DAADAAAAAAAADADDA”?
- node.js - 错误:使用 Sequelize 迁移数据库时无法添加外键约束
- python - Eclipse Pydev 中没有模块名称“dns”
- android - Android CameraX 卡在两个用例上
- python - 编辑器不尊重 Python shell 别名