multi:SetOpt_SocketFunction -- callback informed about what to wait for
multi:SetOpt_SocketFunction(socket_callback[, userdata])
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:

Wait for incoming data. For the socket to become readable.
Wait for outgoing data. For the socket to become writable.
Wait for incoming and outgoing data. For the socket to become readable or writable.
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.

input value
optional: user data to pass to callback function

Show TOC