Hello!
On Wed, Dec 5, 2012 at 1:40 PM, Mohammad Reza Kolahdouzan wrote:
>
> I am trying to use lua module for nginx, but I am getting error message when
> I try to use ngx.socket.udp(). The error message is "no request found". The
> lua statement is simply "udp_socket = ngx.socket.udp()", and it fails at
> this statement.
>
> I am using nginx 1.2.4, LuaJIT 2.0.0 and lua nginx module 0.7.4.
>
> Any idea what could be wrong?
>
> forgot to mention that I am using it in the context of init_by_lua, should I not use it there?
The ngx.socket.udp API is not available in the context of init_by_lua.
You can check out the "context" list in the documentation for
ngx.socket.udp:
http://wiki.nginx.org/HttpLuaModule#ngx.socket.udp
To quote:
"context: rewrite_by_lua*, access_by_lua*, content_by_lua*"
We can see that there's no "init_by_lua*" listed ;)
I'm cc'ing the openresty-en mailing list:
https://groups.google.com/group/openresty-en You're very welcome to
join us and ask questions there :)
Thanks!
-agentzh