~ubuntu-branches/ubuntu/maverick/curl/maverick

« back to all changes in this revision

Viewing changes to docs/libcurl/curl_easy_send.3

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-18 15:21:57 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20080618152157-j8b12047aqcl6kii
Tags: upstream-7.18.2
ImportĀ upstreamĀ versionĀ 7.18.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" **************************************************************************
 
2
.\" *                                  _   _ ____  _
 
3
.\" *  Project                     ___| | | |  _ \| |
 
4
.\" *                             / __| | | | |_) | |
 
5
.\" *                            | (__| |_| |  _ <| |___
 
6
.\" *                             \___|\___/|_| \_\_____|
 
7
.\" *
 
8
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 
9
.\" *
 
10
.\" * This software is licensed as described in the file COPYING, which
 
11
.\" * you should have received as part of this distribution. The terms
 
12
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
 
13
.\" *
 
14
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
 
15
.\" * copies of the Software, and permit persons to whom the Software is
 
16
.\" * furnished to do so, under the terms of the COPYING file.
 
17
.\" *
 
18
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 
19
.\" * KIND, either express or implied.
 
20
.\" *
 
21
.\" * $Id: curl_easy_send.3,v 1.1 2008-05-12 21:43:28 bagder Exp $
 
22
.\" **************************************************************************
 
23
.\"
 
24
.TH curl_easy_send 3 "29 April 2008" "libcurl 7.18.2" "libcurl Manual"
 
25
.SH NAME
 
26
curl_easy_send - sends raw data over an "easy" connection 
 
27
.SH SYNOPSIS
 
28
.B #include <curl/easy.h>
 
29
.sp
 
30
.BI "CURLcode curl_easy_send( CURL *" curl ", const void *" buffer ","
 
31
.BI " size_t " buflen ", size_t *" n ");"
 
32
.ad
 
33
.SH DESCRIPTION
 
34
This function sends arbitrary data over the established connection. You may
 
35
use it together with \fIcurl_easy_recv(3)\fP to implement custom protocols
 
36
using libcurl. This functionality can be particularly useful if you use
 
37
proxies and/or SSL encryption: libcurl will take care of proxy negotiation and
 
38
connection set-up.
 
39
 
 
40
\fBbuffer\fP is a pointer to the data of length \fBbuflen\fP that you want sent.
 
41
The variable \fBn\fP points to will receive the number of sent bytes.
 
42
 
 
43
To establish the connection, set \fBCURLOPT_CONNECT_ONLY\fP option before
 
44
calling \fIcurl_easy_perform(3)\fP. Note that \fIcurl_easy_send(3)\fP will not
 
45
work on connections that were created without this option.
 
46
 
 
47
You must ensure that the socket is writable before calling
 
48
\fIcurl_easy_send(3)\fP, otherwise the call will return \fBCURLE_AGAIN\fP -
 
49
the socket is used in non-blocking mode internally. Use
 
50
\fIcurl_easy_getinfo(3)\fP with \fBCURLINFO_LASTSOCKET\fP to obtain the
 
51
socket; use your operating system facilities like \fIselect(2)\fP to check if
 
52
it can be written to.
 
53
.SH AVAILABILITY
 
54
Added in 7.18.2.
 
55
.SH RETURN VALUE
 
56
On success, returns \fBCURLE_OK\fP and stores the number of bytes actually
 
57
sent into \fB*n\fP. Note that this may very well be less than the amount you
 
58
wanted to send.
 
59
 
 
60
On failure, returns the appropriate error code.
 
61
.SH EXAMPLE
 
62
See \fBsendrecv.c\fP in \fBdocs/examples\fP directory for usage example.
 
63
.SH "SEE ALSO"
 
64
.BR curl_easy_setopt "(3), " curl_easy_perform "(3), " curl_easy_getinfo "(3), "
 
65
.BR curl_easy_recv "(3) "