Lua socket asynchronous calls

Я пишу программу, которая использует сокет Lua для связи с http-сервером. Я использую API-интерфейс socket.http.request, и я обнаружил, что он синхронный. Насколько я понимаю, он ждет, пока не получит ответ или тайм-аут. Is my understanding correct? If so, I'd prefer to use an asynchronous API.

I also found another API "socket.http.request_cb", which calls a call back function when the request is processed. However, it doesn't seem to work here. (This API is not available on the version that I'm using.) I'm using Lua 5.1 and Lua socket 2.0.2 here. Could anyone let me know which version of Lua or Lua socket has this API?

11
задан greatwolf 24 June 2014 в 23:32
поделиться