linux 1900端口,luasocket从端口1900发送UDP数据(luasocket send UDP data from port 1900)

luasocket从端口1900发送UDP数据(luasocket send UDP data from port 1900)

我正试图从我的家庭自动化控制器Emulate Belkin wemo开关发送来自amazon Echo的语音命令。控制器支持lua语言。

我正在跟踪此文件 ,将UDP数据从Controller的1900端口发送到Echo的端口50000。 现在我每次发送数据时Socket都会随机端口发送数据而不是从端口1900发送数据。回显只做有效连接并回复数据是否来自端口1900.我在最近两天摸不着头脑但还没想出来。

贝娄是我的代码。

strData1 =

'HTTP/1.1 200 OK' ..

'HOST: 239.255.255.250:1900'..

'CACHE-CONTROL: max-age=100'..

'EXT:'..

'LOCATION: http://192.168.1.152:49153/description.xml'..

'SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.19.0'..

'hue-bridgeid: B8AC6FFFFEC53475'..

'ST: upnp:rootdevice'..

'USN: uuid:2f402f80-da50-11e1-9b23-b8ac6fc53475::upnp:rootdevice'

local socket = require "socket"

local udp = socket.udp()

udp:settimeout(0)

udp:setsockname('*', 1900)

udp:setpeername('192.168.1.102', 50000) -- Echo IP and Port number

udp:sendto(strData1,'192.168.1.102',50000)

I am trying to Emulate Belkin wemo switch from my Home automation controller to send voice command from amazon Echo.The controller supports lua language.

I am following up this file to send the UDP data from port 1900 of Controller to port 50000 of Echo. right now every time i send the data the Socket take the random port send data not from port 1900. Echo only make valid connection and reply if the data comes from the port 1900. I am scratching my head from last two

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值