Lua Socket: Difference between revisions

From Spring
Jump to navigationJump to search
Abma (talk | contribs)
No edit summary
Abma (talk | contribs)
Line 12: Line 12:
*dns resolving is blocking
*dns resolving is blocking
*allow rules have exactly match the host:port in script. currently its not possible to use host:port in a lua widget and use the resolved hostname for connecting (and vice versa) (simple workaround, add both as rule)
*allow rules have exactly match the host:port in script. currently its not possible to use host:port in a lua widget and use the resolved hostname for connecting (and vice versa) (simple workaround, add both as rule)
*socket=require("socket") is needed
*[https://github.com/spring/spring/blob/luasocket/cont/examples/Widgets/luasocket.lua#L15 socket=require("socket")] is needed
*most lua scripts from luasocket won't work as they are blocking! rewriting them non-blocking is required! (should be in most cases few work, as parsing stuff can be reused)
*most lua scripts from luasocket won't work as they are blocking! rewriting them non-blocking is required! (should be in most cases few work, as parsing stuff can be reused)
*udp sendto isn't checked, only binding the udp-socket
*udp sendto isn't checked, only binding the udp-socket

Revision as of 00:37, 30 January 2012

LuaSocket is a development branch of spring:

see https://github.com/spring/spring/tree/luasocket


example code

see https://github.com/spring/spring/blob/luasocket/cont/examples/Widgets/luasocket.lua

Notes / known issues / TODO

  • dns resolving is blocking
  • allow rules have exactly match the host:port in script. currently its not possible to use host:port in a lua widget and use the resolved hostname for connecting (and vice versa) (simple workaround, add both as rule)
  • socket=require("socket") is needed
  • most lua scripts from luasocket won't work as they are blocking! rewriting them non-blocking is required! (should be in most cases few work, as parsing stuff can be reused)
  • udp sendto isn't checked, only binding the udp-socket

documentation