how to perform non-blocking net.listen_tcp
Posted: 13 Mar 2012 16:05
How can I perform a non-blockin net.listen_tcp in lua?
Currently from the readme I am using the following script:
The readme said that: Poll on the fds with the net.POLLIN flag if you want to be non blocking. The fds method returns a list of fds you can call poll on before using the accept method.
Which part of the code I should modify to make it become a non blocking listen? Please help here thanks!
Currently from the readme I am using the following script:
Code: Select all
local l = vlc.net.listen_tcp( "localhost", 1234 )
while true do
local fd = l:accept()
if fd >= 0 do
net.send( fd, "blabla" )
net.close( fd )
end
end
Which part of the code I should modify to make it become a non blocking listen? Please help here thanks!