lunarmodules / luasocket

Network support for the Lua language
http://lunarmodules.github.io/luasocket/
MIT License
1.85k stars 629 forks source link

Timeout on socket.dns.toip() #137

Closed subnetmarco closed 9 years ago

subnetmarco commented 9 years ago

Is it possible to set a timeout on socket.dns.toip() ?

diegonehab commented 9 years ago

Not really. You'd need an external library for that. LuaSocket uses POSIX calls and they do not support timeout.

JasperBRiedel commented 9 years ago

You could try running the method "socket.dns.toip()" in another thread, and if the timeout is reached just kill the thread. Of course you'd then need another library for some kind of thread implementation. Not sure if it helps, Just an idea I had....