Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lua http socket timeout

The LuaSocket HTTP module documentation says that a timeout can be set on a HTTP connection:

The following constants can be set to control the default behavior of the HTTP module:

PORT: default port used for connections; PROXY: default proxy used for connections; TIMEOUT: sets the timeout for all I/O operations; USERAGENT: default user agent reported to server. http://w3.impa.br/~diego/software/luasocket/http.htm

How do I set these constants in a lua script?

like image 779
ripat Avatar asked May 16 '11 10:05

ripat


1 Answers

It was easier than I thought. simply

local mysocket = require("socket.http")
mysocket.TIMEOUT = 5
like image 69
ripat Avatar answered Sep 17 '22 09:09

ripat