neon API reference NESESIONCREATE(3)
NAME
nesessioncreate, necloseconnection, nesessionproxy,
nesessiondestroy - set up HTP sessions
SYNOPSIS
#include
nesession *nesessioncreate (const char *scheme,
const char *hostname,
unsigned int port);
void nesessionproxy (nesession *session,
const char *hostname,
unsigned int port);
void necloseconnection (nesession *session);
void nesessiondestroy (nesession *session);
DESCRIPTION
An nesession object represents an HTP session - a logical
grouping of a sequence of HTP requests made to a certain
server. Any requests made using the session can use a per-
sistent connection, share cached authentication credentials
and any other common attributes.
A new HTP session is created using nesessioncreate, giv-
ing the hostname and port of the server to use, along with
the scheme used to contact the server (usually "http"). Be-
fore the first use of nesessioncreate in a process,
nesockinit(3) must have been called to perform any global
initialization needed by any libraries used by neon.
To enable SL/TLS for the session, pass the string "https"
as the scheme parameter, and either register a certificate
verification function (see nesslsetverify(3)) or trust
the appropriate certificate (see nessltrustcert(3),
nessltrustdefaultca(3)).
If an HTP proxy server should be used for the session,
nesessionproxy must be called giving the hostname and port
on which to contact the proxy.
If it is known that the session will not be used for a sig-
nificant period of time, necloseconnection can be called
to close the connection, if one remains open. Use of this
neon 0.25.5 Last change: 20 January 2006 1
neon API reference NESESIONCREATE(3)
function is entirely optional, but it must not be called if
there is a request active using the session.
Once a session has been completed, nesessiondestroy must
be called to destroy the resources associated with the ses-
sion. Any subsequent use of the session pointer produces un-
defined behaviour.
NOTES
The hostname passed to nesessioncreate is resolved when
the first request using the session is dispatched; a DNS
resolution failure can only be detected at that time (using
the NELOKUP error code); see nerequestdispatch(3) for
details.
RETURN VALUES
nesessioncreate will return a pointer to a new session ob-
ject (and never NUL).
EXAMPLES
Create and destroy a session:
nesession *sess;
sess = nesessioncreate("http", "host.example.com", 80);
/* ... use sess ... */
nesessiondestroy(sess);
SEE ALSO
nesslsetverify(3), nessltrustcert(3), nesockinit(3)
AUTHOR
Joe Orton .
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
box; cbp-1 cbp-1 l l . ATRIBUTE TYPE ATRIBUTE VALUE =
Availability SUNWneon = Interface Stability Volatile
NOTES
Source for Neon is available on http:/opensolaris.org.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
neon 0.25.5 Last change: 20 January 2006 2
neon API reference NESESIONCREATE(3)
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWneon
Interface Stability Volatile
NOTES
Source for Neon is available on http:/opensolaris.org.
neon 0.25.5 Last change: 20 January 2006 3
|