multi:SetOpt_SocketFunction(socket_callback[, userdata])
When the multi:SocketAction() function runs, it informs the application about updates in the socket (file descriptor) status by doing none, one, or multiple calls to the socket callback. The callback gets status updates with changes since the previous time the callback was called.
The callback receives three arguments: The first argument is an easy handle, the second argument is a socket descriptor, and the third argument informs the callback on the status of the given socket. It can hold one of these values:
#CURL_POLL_IN
#CURL_POLL_OUT
#CURL_POLL_INOUT
#CURL_POLL_REMOVE
If you pass the optional userdata
argument, the value you pass in userdata
will
be passed to your callback function as a fourth parameter. The userdata
parameter
can be of any type.