为了让它发挥作用,我一直在努力。
有人可以提供一个包含 2 个脚本的任意 LUA api 来回传递消息的示例吗?
我努力了Oil http://webserver2.tecgraf.puc-rio.br/~maia/oil/, lua-ipc https://github.com/siffiejoe/lua-luaipc/tree/master/tests and zeromq http://zeromq.org/。
但我面临几个缺少库的问题。
最终目标是将数字向量从一个 Lua 进程传递到另一个 Lua 进程(使用不同版本的 Lua),而不通过磁盘。
这里有一个类似的IPC的Python示例 https://stackoverflow.com/questions/6920858/interprocess-communication-in-python在一个文件中。 lua 中类似的东西会非常有帮助。
我真的需要一个example因为我对管道或 UDP/TCP 的了解不强。
相当于使用 luasocket。这些示例非常接近给出的 python 示例。这里使用socket:receive()来进行分帧。
https://github.com/diegonehab/luasocket/blob/master/samples/listener.lua https://github.com/diegonehab/luasocket/blob/master/samples/listener.lua
https://github.com/diegonehab/luasocket/blob/master/samples/talker.lua https://github.com/diegonehab/luasocket/blob/master/samples/talker.lua
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)