Module irccd.socket.listener
Listener object.
Wraps the select() calls in a convenient way.
Functions
new () | Create a listener. |
Class Listener
Listener:add (sock) | Add a socket to the listener. |
Listener:remove (sock) | Remove the socket from the listener. |
Listener:clear () | Remove all sockets from the listener. |
Listener:select (seconds, microseconds) | Select a socket ready for input. |
Functions
Class Listener
- Listener:add (sock)
-
Add a socket to the listener.
Parameters:
- sock the socket
- Listener:remove (sock)
-
Remove the socket from the listener.
Parameters:
- sock the socket to remove
- Listener:clear ()
- Remove all sockets from the listener.
- Listener:select (seconds, microseconds)
-
Select a socket ready for input.
If both seconds and microseconds are set to 0 (which is the default),
the listener waits indefinitely.
Parameters:
- seconds optional seconds, default 0
- microseconds optional microseconds, default 0
Returns:
- the selected socket or nil
- the error message