.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "NE_SET_USERAGENT" 3 "20 January 2006" "neon 0.25.5" "neon API reference"
.SH NAME
ne_set_useragent, ne_set_persist, ne_set_read_timeout, ne_get_scheme, ne_get_server_hostport \- common properties for HTTP sessions
.SH "SYNOPSIS"
.ad l
.hy 0

#include <ne_session\&.h>
.sp
.HP 23
void\ \fBne_set_useragent\fR\ (ne_session\ *\fIsession\fR, const\ char\ *\fIproduct\fR);
.HP 21
void\ \fBne_set_persist\fR\ (ne_session\ *\fIsession\fR, int\ \fIflag\fR);
.HP 26
void\ \fBne_set_read_timeout\fR\ (ne_session\ *\fIsession\fR, int\ \fItimeout\fR);
.HP 28
const\ char\ *\fBne_get_scheme\fR\ (ne_sesssion\ *\fIsession\fR);
.HP 37
const\ char\ *\fBne_get_server_hostport\fR\ (ne_sesssion\ *\fIsession\fR);
.ad
.hy

.SH "DESCRIPTION"

.PP
The User\-Agent request header is used to identify the software which generated the request for statistical or debugging purposes\&. neon does not send a User\-Agent header unless a call is made to the \fBne_set_useragent\fR\&. \fBne_set_useragent\fR must be passed a product string conforming to RFC2616's product token grammar; of the form "Product/Version"\&.

.PP
By default neon will use a persistent connection whenever possible\&. For specific applications, or for debugging purposes, it is sometimes useful to disable persistent connections\&. The \fBne_set_persist\fR function will disable persistent connections if passed a \fIflag\fR parameter of 0, and will enable them otherwise\&.

.PP
When neon reads from a socket, by default the read operation will time out after 60 seconds, and the request will fail giving an \fBNE_TIMEOUT\fR error\&. To configure this timeout interval, call \fBne_set_read_timeout\fR giving the desired number of seconds as the \fItimeout\fR parameter\&.

.PP
The scheme used to initially create the session will be returned by \fBne_get_scheme\fR\&.

.PP
The hostport pair with which the session is associated will be returned by the \fBne_get_server_hostport\fR; for example www\&.example\&.com:8080\&. Note that the :port will be omitted if the default port for the scheme is used\&.

.SH "EXAMPLES"

.PP
Set a user\-agent string:

.nf
ne_session *sess = ne_session_create(\&.\&.\&.);
ne_set_useragent(sess, "MyApplication/2\&.1");
.fi

.PP
Disable use of persistent connections:

.nf
ne_session *sess = ne_session_create(\&.\&.\&.);
ne_set_persist(sess, 0);
.fi

.PP
Set a 30 second read timeout:

.nf
ne_session *sess = ne_session_create(\&.\&.\&.);
ne_set_read_timeout(sess, 30);
.fi

.SH AUTHOR
Joe Orton <neon@webdav\&.org>.
