LUA脚本 - Web套接字通信 [英] LUA Script - web socket communication

查看:831
本文介绍了LUA脚本 - Web套接字通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用基于Linux的机器和android应用程序之间。

I am working with between Linux-based machine and android app.

首先,我需要在机器上打开一个服务器套接字与应用程序进行通信。

First of all, I need to open a server socket on the machine to communicate with the app.

我需要用LUA Script编码,我不知道。

I need to code with LUA Script, and I have no idea with it..

请给我一些例子打开一个服务器套接字并从Android应用程序接收消息。

Could you please give me some exmaple to open a server socket and receive the message from android app?

谢谢。

推荐答案

如果您在Lua中寻找websocket支持,请尝试 lua-websockets

If you are looking for websocket support in Lua, try lua-websockets.

对于常规套接字,可以使用luasocket; 简介页面包括通过TCP处理的回显服务器示例;此答案包括客户端示例。

For regular sockets, you can use luasocket; the introduction page includes an echo server example working over TCP; this SO answer includes a client example.

这篇关于LUA脚本 - Web套接字通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆