Install curl-7.19.5.tar.bz2
[msysgit/bosko.git] / mingw / share / man / man3 / curl_multi_assign.3
blob877b6ddfcd4ee88bba75693f8da8eb3b3e970431
1 .\" $Id: curl_multi_assign.3,v 1.2 2008-12-28 21:56:56 bagder Exp $
2 .\"
3 .TH curl_multi_assign 3 "9 Jul 2006" "libcurl 7.16.0" "libcurl Manual"
4 .SH NAME
5 curl_multi_assign \- set data to association with an internal socket
6 .SH SYNOPSIS
7 #include <curl/curl.h>
9 CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd,
10                             void *sockptr);
11 .SH DESCRIPTION
12 This function assigns an association in the multi handle between the given
13 socket and a private pointer of the application. This is (only) useful for
14 \fIcurl_multi_socket(3)\fP uses.
16 When set, the \fIsockptr\fP pointer will be passed to all future socket
17 callbacks for the specific \fIsockfd\fP socket.
19 If the given \fIsockfd\fP isn't already in use by libcurl, this function will
20 return an error.
22 libcurl only keeps one single pointer associated with a socket, so calling
23 this function several times for the same socket will make the last set pointer
24 get used.
26 The idea here being that this association (socket to private pointer) is
27 something that just about every application that uses this API will need and
28 then libcurl can just as well do it since it already has an internal hash
29 table lookup for this.
30 .SH "RETURN VALUE"
31 The standard CURLMcode for multi interface error codes.
32 .SH "TYPICAL USAGE"
33 In a typical application you allocate a struct or at least use some kind of
34 semi-dynamic data for each socket that we must wait for action on when using
35 the \fIcurl_multi_socket(3)\fP approach.
37 When our socket-callback gets called by libcurl and we get to know about yet
38 another socket to wait for, we can use \fIcurl_multi_assign(3)\fP to point out
39 the particular data so that when we get updates about this same socket again,
40 we don't have to find the struct associated with this socket by ourselves.
41 .SH AVAILABILITY
42 This function was added in libcurl 7.15.5, although not deemed stable yet.
43 .SH "SEE ALSO"
44 .BR curl_multi_setopt "(3), " curl_multi_socket "(3) "