| 1 |
assign(sock_fd, object) -> None |
| 2 |
|
| 3 |
Creates an association in the multi handle between the given socket and |
| 4 |
a private object in the application. |
| 5 |
Corresponds to `curl_multi_assign`_ in libcurl. |
| 6 |
The multi handle keeps a strong reference to the assigned object. |
| 7 |
|
| 8 |
``assign()`` may be called from inside the ``M_SOCKETFUNCTION`` callback; |
| 9 |
this is the typical place to attach per-socket state. The new value takes |
| 10 |
effect for *future* callbacks for that socket -- the ``socketp`` argument |
| 11 |
already passed to the in-flight callback is not mutated. |
| 12 |
|
| 13 |
If ``object`` is ``None``, clears any association for the socket. |
| 14 |
For convenience, :py:meth:`pycurl.CurlMulti.unassign` is equivalent to |
| 15 |
``multi.assign(sock_fd, None)``. |
| 16 |
|
| 17 |
.. _curl_multi_assign: https://curl.haxx.se/libcurl/c/curl_multi_assign.html |