Hello!
永远不要在 OpenResty 使用 LuaSocket 这个库,它的网络 I/O 会阻塞 nginx 事件循环。应当总是使用
OpenResty 自己的 cosocket API(ngx.socket.tcp 和 ngx.socket.udp 这些),以及基于
cosocket 的那些上层 lua-resty-* 库,比如 lua-resty-mysql(这也是默认包含在 OpenResty
里的)。
唉,老生长谈了。建议仔细阅读官方文档。
Regards,
Yichun
2017-09-19 23:28 GMT-07:00 <hzwi...@gmail.com>:
> 2017/09/20 14:04:08 [error] 17120#14792: *1321 lua entry thread aborted:
> runtime error: lualib/socket.lua:12: module 'socket.core' not found:
>
> 尝试用了 require("resty.exec.socket"), 同样报错
> 2017/09/20 14:22:55 [error] 17536#2884: *1341 lua entry thread aborted:
> runtime error: lualib/resty\exec\socket.lua:1: module 'netstring' not found:
>
>
> 请问春哥可有办法解决?
>
> --
>