Commit deb38e43 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Lua: disable net.(poll|read|write) on Windows and document

These functions assume that sockets are file descriptors, never worked
properly on Windows. See also 3841c085.
parent b4341b05
......@@ -189,6 +189,7 @@ static int vlclua_net_recv( lua_State *L )
return 1;
}
#ifndef _WIN32
/*****************************************************************************
*
*****************************************************************************/
......@@ -277,6 +278,7 @@ static int vlclua_fd_read( lua_State *L )
lua_pushnil( L );
return 1;
}
#endif
/*****************************************************************************
*
......@@ -366,9 +368,11 @@ static const luaL_Reg vlclua_net_reg[] = {
{ "close", vlclua_net_close },
{ "send", vlclua_net_send },
{ "recv", vlclua_net_recv },
#ifndef _WIN32
{ "poll", vlclua_net_poll },
{ "read", vlclua_fd_read },
{ "write", vlclua_fd_write },
#endif
{ "stat", vlclua_stat }, /* Not really "net" */
{ "opendir", vlclua_opendir }, /* Not really "net" */
{ NULL, NULL }
......
......@@ -185,10 +185,13 @@ net.send( fd, string, [length] ): Send data on fd.
net.recv( fd, [max length] ): Receive data from fd.
net.poll( { fd = events } ): Implement poll function.
Returns the numbers of file descriptors with a non 0 revent. The function
modifies the input table to { fd = revents }. See "man poll".
modifies the input table to { fd = revents }. See "man poll". This function
is not available on Windows.
net.POLLIN/POLLPRI/POLLOUT/POLLRDHUP/POLLERR/POLLHUP/POLLNVAL: poll event flags
net.read( fd, [max length] ): Read data from fd.
net.write( fd, string, [length] ): Write data to fd.
net.read( fd, [max length] ): Read data from fd. This function is not
available on Windows.
net.write( fd, string, [length] ): Write data to fd. This function is not
available on Windows.
net.stat( path ): Stat a file. Returns a table with the following fields:
.type
.mode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment