fields "protocol", "username", "password", "host", "port", path" and
"option".
net.listen_tcp( host, port ): Listen to TCP connections. This returns an
- object with an accept and an fds method. The accept takes an optional timeout
- argument (in milliseconds). The fds method returns a list of fds you can call
- select on before using the accept method. For example:
+ object with an accept and an fds method. accept is blocking (Poll on the
+ fds with the net.POLLIN flag if you want to be non blockin).
+ The fds method returns a list of fds you can call select on before using
+ the accept method. For example:
local l = vlc.net.listen_tcp( "localhost", 1234 )
while true do
- local fd = l:accept( 500 )
+ local fd = l:accept()
if fd >= 0 do
net.send( fd, "blabla" )
net.close( fd )