File: Poco.Net.HTTPSession.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (175 lines) | stat: -rw-r--r-- 14,214 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Net::HTTPSession</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class HTTPSession</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> HTTP<br />
<b>Header:</b> Poco/Net/HTTPSession.h</p>
<h2>Description</h2>
<div class="description">
<p><a href="Poco.Net.HTTPSession.html" title="class Poco::Net::HTTPSession">HTTPSession</a> implements basic HTTP session management for both HTTP clients and HTTP servers. </p>
<p><a href="Poco.Net.HTTPSession.html" title="class Poco::Net::HTTPSession">HTTPSession</a> implements buffering for HTTP connections, as well as specific support for the various HTTP stream classes. </p>
<p>This class can not be instantiated. <a href="Poco.Net.HTTPClientSession.html" title="class Poco::Net::HTTPClientSession">HTTPClientSession</a> or <a href="Poco.Net.HTTPServerSession.html" title="class Poco::Net::HTTPServerSession">HTTPServerSession</a> must be used instead. </p>
</div>
<h2>Inheritance</h2>
<p><b>Known Derived Classes: </b><a href="Poco.Net.HTTPClientSession.html" title="class Poco::Net::HTTPClientSession">HTTPClientSession</a>, <a href="Poco.Net.HTTPServerSession.html" title="class Poco::Net::HTTPServerSession">HTTPServerSession</a>, <a href="Poco.Net.HTTPSClientSession.html" title="class Poco::Net::HTTPSClientSession">HTTPSClientSession</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.HTTPSession.html#13169" title="Poco::Net::HTTPSession::abort()">abort</a>, <a href="Poco.Net.HTTPSession.html#13197" title="Poco::Net::HTTPSession::attachSocket()">attachSocket</a>, <a href="Poco.Net.HTTPSession.html#13192" title="Poco::Net::HTTPSession::buffered()">buffered</a>, <a href="Poco.Net.HTTPSession.html#13199" title="Poco::Net::HTTPSession::close()">close</a>, <a href="Poco.Net.HTTPSession.html#13195" title="Poco::Net::HTTPSession::connect()">connect</a>, <a href="Poco.Net.HTTPSession.html#13168" title="Poco::Net::HTTPSession::connected()">connected</a>, <a href="Poco.Net.HTTPSession.html#13173" title="Poco::Net::HTTPSession::detachSocket()">detachSocket</a>, <a href="Poco.Net.HTTPSession.html#13181" title="Poco::Net::HTTPSession::get()">get</a>, <a href="Poco.Net.HTTPSession.html#13164" title="Poco::Net::HTTPSession::getKeepAlive()">getKeepAlive</a>, <a href="Poco.Net.HTTPSession.html#13167" title="Poco::Net::HTTPSession::getTimeout()">getTimeout</a>, <a href="Poco.Net.HTTPSession.html#13170" title="Poco::Net::HTTPSession::networkException()">networkException</a>, <a href="Poco.Net.HTTPSession.html#13182" title="Poco::Net::HTTPSession::peek()">peek</a>, <a href="Poco.Net.HTTPSession.html#13183" title="Poco::Net::HTTPSession::read()">read</a>, <a href="Poco.Net.HTTPSession.html#13189" title="Poco::Net::HTTPSession::receive()">receive</a>, <a href="Poco.Net.HTTPSession.html#13194" title="Poco::Net::HTTPSession::refill()">refill</a>, <a href="Poco.Net.HTTPSession.html#13200" title="Poco::Net::HTTPSession::setException()">setException</a>, <a href="Poco.Net.HTTPSession.html#13162" title="Poco::Net::HTTPSession::setKeepAlive()">setKeepAlive</a>, <a href="Poco.Net.HTTPSession.html#13165" title="Poco::Net::HTTPSession::setTimeout()">setTimeout</a>, <a href="Poco.Net.HTTPSession.html#13193" title="Poco::Net::HTTPSession::socket()">socket</a>, <a href="Poco.Net.HTTPSession.html#13186" title="Poco::Net::HTTPSession::write()">write</a></p>
<h2>Enumerations</h2>
<h3><i>Anonymous</i></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="13172">HTTP_PORT</a> = 80</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="13174">HTTPSession</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.HTTPSession.html" title="class Poco::Net::HTTPSession">HTTPSession</a>();</p>
<div class="description">
<p>Creates a HTTP session using an unconnected stream socket. </p>
</div>
<h3><a name="13175">HTTPSession</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.HTTPSession.html" title="class Poco::Net::HTTPSession">HTTPSession</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a> &amp; socket<br />);</p>
<div class="description">
<p>Creates a HTTP session using the given socket. The session takes ownership of the socket and closes it when it's no longer used. </p>
</div>
<h3><a name="13177">HTTPSession</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.HTTPSession.html" title="class Poco::Net::HTTPSession">HTTPSession</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a> &amp; socket,<br />&nbsp;&nbsp;&nbsp;&nbsp;bool keepAlive<br />);</p>
<div class="description">
<p>Creates a HTTP session using the given socket. The session takes ownership of the socket and closes it when it's no longer used. </p>
</div>
<h2>Destructor</h2>
<h3><a name="13180">~HTTPSession</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual ~<a href="Poco.Net.HTTPSession.html" title="class Poco::Net::HTTPSession">HTTPSession</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.HTTPSession.html" title="class Poco::Net::HTTPSession">HTTPSession</a> and closes the underlying socket. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="13169">abort</a></h3>
<p class="decl">void abort();</p>
<div class="description">
<p>Aborts a session in progress by shutting down and closing the underlying socket. </p>
</div>
<h3><a name="13168">connected</a></h3>
<p class="decl">bool connected() const;</p>
<div class="description">
<p>Returns true if the underlying socket is connected. </p>
</div>
<h3><a name="13173">detachSocket</a></h3>
<p class="decl"><a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a> detachSocket();</p>
<div class="description">
<p>Detaches the socket from the session. </p>
<p>The socket is returned, and a new, uninitialized socket is attached to the session. </p>
</div>
<h3><a name="13164">getKeepAlive</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getKeepAlive() const;</p>
<div class="description">
<p>Returns the value of the keep-alive flag for this session. </p>
</div>
<h3><a name="13167">getTimeout</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> getTimeout() const;</p>
<div class="description">
<p>Returns the timeout for the HTTP session. </p>
</div>
<h3><a name="13170">networkException</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const <a href="Poco.Exception.html" title="class Poco::Exception">Poco::Exception</a> * networkException() const;</p>
<div class="description">
<p>If sending or receiving data over the underlying socket connection resulted in an exception, a pointer to this exception is returned. </p>
<p>Otherwise, NULL is returned. </p>
</div>
<h3><a name="13162">setKeepAlive</a></h3>
<p class="decl">void setKeepAlive(<br />&nbsp;&nbsp;&nbsp;&nbsp;bool keepAlive<br />);</p>
<div class="description">
<p>Sets the keep-alive flag for this session. </p>
<p>If the keep-alive flag is enabled, persistent HTTP/1.1 connections are supported. </p>
</div>
<h3><a name="13165">setTimeout</a></h3>
<p class="decl">void setTimeout(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Timespan.html" title="class Poco::Timespan">Poco::Timespan</a> &amp; timeout<br />);</p>
<div class="description">
<p>Sets the timeout for the HTTP session. </p>
</div>
<h3><a name="13197">attachSocket</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void attachSocket(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a> &amp; socket<br />);</p>
<div class="description">
<p>Attaches a socket to the session, replacing the previously attached socket. </p>
</div>
<h3><a name="13192">buffered</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int buffered() const;</p>
<div class="description">
<p>Returns the number of bytes in the buffer. </p>
</div>
<h3><a name="13199">close</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void close();</p>
<div class="description">
<p>Closes the underlying socket. </p>
</div>
<h3><a name="13195">connect</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual void connect(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Net.SocketAddress.html" title="class Poco::Net::SocketAddress">SocketAddress</a> &amp; address<br />);</p>
<div class="description">
<p>Connects the underlying socket to the given address and sets the socket's receive timeout.	 </p>
</div>
<h3><a name="13181">get</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int get();</p>
<div class="description">
<p>Returns the next byte in the buffer. Reads more data from the socket if there are no bytes left in the buffer. </p>
</div>
<h3><a name="13182">peek</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int peek();</p>
<div class="description">
<p>Peeks at the next character in the buffer. Reads more data from the socket if there are no bytes left in the buffer. </p>
</div>
<h3><a name="13183">read</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int read(<br />&nbsp;&nbsp;&nbsp;&nbsp;char * buffer,<br />&nbsp;&nbsp;&nbsp;&nbsp;std::streamsize length<br />);</p>
<div class="description">
<p>Reads up to length bytes. </p>
<p>If there is data in the buffer, this data is returned. Otherwise, data is read from the socket to avoid unnecessary buffering. </p>
</div>
<h3><a name="13189">receive</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">int receive(<br />&nbsp;&nbsp;&nbsp;&nbsp;char * buffer,<br />&nbsp;&nbsp;&nbsp;&nbsp;int length<br />);</p>
<div class="description">
<p>Reads up to length bytes. </p>
</div>
<h3><a name="13194">refill</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void refill();</p>
<div class="description">
<p>Refills the internal buffer. </p>
</div>
<h3><a name="13200">setException</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void setException(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Exception.html" title="class Poco::Exception">Poco::Exception</a> &amp; exc<br />);</p>
<div class="description">
<p>Stores a clone of the exception. </p>
</div>
<h3><a name="13193">socket</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.StreamSocket.html" title="class Poco::Net::StreamSocket">StreamSocket</a> &amp; socket();</p>
<div class="description">
<p>Returns a reference to the underlying socket. </p>
</div>
<h3><a name="13186">write</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">virtual int write(<br />&nbsp;&nbsp;&nbsp;&nbsp;const char * buffer,<br />&nbsp;&nbsp;&nbsp;&nbsp;std::streamsize length<br />);</p>
<div class="description">
<p>Writes data to the socket. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>