Name
multi:SetOpt_SocketFunction -- callback informed about what to wait for
Synopsis
multi:SetOpt_SocketFunction(socket_callback[, userdata])
Function
Pass a callback function.

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
Wait for incoming data. For the socket to become readable.
#CURL_POLL_OUT
Wait for outgoing data. For the socket to become writable.
#CURL_POLL_INOUT
Wait for incoming and outgoing data. For the socket to become readable or writable.
#CURL_POLL_REMOVE
The specified socket/file descriptor is no longer used by libcurl.

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.

Inputs
socket_callback
input value
userdata
optional: user data to pass to callback function

Show TOC