mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-25 20:18:21 +01:00
Use poll by default for socket.connect(), instead of select().
Connect timeouts are implemented by waiting on the new socket descriptor. When select() is used for this, it imposes an arbitrary limit on the number of connections that can be made, usually 1024-3. Using poll() removes this limit on the number of simultaneous TCP connections can be made using luasocket. The previous default implementation using select() is available by defining SOCKET_SELECT. Note that using socket.select() always uses select(), so it isn't possible to wait on an arbitrary number of connections at once.
This commit is contained in:
parent
21698c7665
commit
f63d616bc0
@ -16,7 +16,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* Wait for readable/writable/connected socket with timeout
|
||||
\*-------------------------------------------------------------------------*/
|
||||
#ifdef SOCKET_POLL
|
||||
#ifndef SOCKET_SELECT
|
||||
#include <sys/poll.h>
|
||||
|
||||
#define WAITFD_R POLLIN
|
||||
|
Loading…
Reference in New Issue
Block a user