1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<link rel="STYLESHEET" href="modpython.css" type='text/css'>
5
<link rel="first" href="modpython.html" title='Mod_python Manual'>
6
<link rel='contents' href='contents.html' title="Contents">
7
<link rel='index' href='genindex.html' title='Index'>
8
<link rel='last' href='about.html' title='About this document...'>
9
<link rel='help' href='about.html' title='About this document...'>
10
<LINK REL="next" href="pyapi-mpconn-mem.html">
11
<LINK REL="prev" href="pyapi-mpconn.html">
12
<LINK REL="parent" href="pyapi-mpconn.html">
13
<LINK REL="next" href="pyapi-mpconn-mem.html">
14
<meta name='aesop' content='information'>
15
<META NAME="description" CONTENT="Connection Methods">
16
<META NAME="keywords" CONTENT="modpython">
17
<META NAME="resource-type" CONTENT="document">
18
<META NAME="distribution" CONTENT="global">
19
<title>4.5.4.1 Connection Methods</title>
4
<link rel="STYLESHEET" href="modpython.css" type='text/css' />
5
<link rel="first" href="modpython.html" title='Mod_python Manual' />
6
<link rel='contents' href='contents.html' title="Contents" />
7
<link rel='index' href='genindex.html' title='Index' />
8
<link rel='last' href='about.html' title='About this document...' />
9
<link rel='help' href='about.html' title='About this document...' />
10
<link rel="next" href="pyapi-mpconn-mem.html" />
11
<link rel="prev" href="pyapi-mpconn.html" />
12
<link rel="parent" href="pyapi-mpconn.html" />
13
<link rel="next" href="pyapi-mpconn-mem.html" />
14
<meta name='aesop' content='information' />
15
<title>4.5.5.1 Connection Methods</title>
22
18
<DIV CLASS="navigation">
19
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
23
20
<table align="center" width="100%" cellpadding="0" cellspacing="2">
25
<td><a rel="prev" title="4.5.4 Connection Object (mp_conn) "
26
href="pyapi-mpconn.html"><img src='previous.gif'
27
border='0' height='32' alt='Previous Page' width='32'></A></td>
28
<td><a rel="parent" title="4.5.4 Connection Object (mp_conn) "
29
href="pyapi-mpconn.html"><img src='up.gif'
30
border='0' height='32' alt='Up One Level' width='32'></A></td>
31
<td><a rel="next" title="4.5.4.2 Connection Members"
32
href="pyapi-mpconn-mem.html"><img src='next.gif'
33
border='0' height='32' alt='Next Page' width='32'></A></td>
22
<td class='online-navigation'><a rel="prev" title="4.5.5 Connection Object (mp_conn)"
23
href="pyapi-mpconn.html"><img src='previous.png'
24
border='0' height='32' alt='Previous Page' width='32' /></A></td>
25
<td class='online-navigation'><a rel="parent" title="4.5.5 Connection Object (mp_conn)"
26
href="pyapi-mpconn.html"><img src='up.png'
27
border='0' height='32' alt='Up One Level' width='32' /></A></td>
28
<td class='online-navigation'><a rel="next" title="4.5.5.2 Connection Members"
29
href="pyapi-mpconn-mem.html"><img src='next.png'
30
border='0' height='32' alt='Next Page' width='32' /></A></td>
34
31
<td align="center" width="100%">Mod_python Manual</td>
35
<td><a rel="contents" title="Table of Contents"
36
href="contents.html"><img src='contents.gif'
37
border='0' height='32' alt='Contents' width='32'></A></td>
38
<td><img src='blank.gif'
39
border='0' height='32' alt='' width='32'></td>
40
<td><a rel="index" title="Index"
41
href="genindex.html"><img src='index.gif'
42
border='0' height='32' alt='Index' width='32'></A></td>
32
<td class='online-navigation'><a rel="contents" title="Table of Contents"
33
href="contents.html"><img src='contents.png'
34
border='0' height='32' alt='Contents' width='32' /></A></td>
35
<td class='online-navigation'><img src='blank.png'
36
border='0' height='32' alt='' width='32' /></td>
37
<td class='online-navigation'><a rel="index" title="Index"
38
href="genindex.html"><img src='index.png'
39
border='0' height='32' alt='Index' width='32' /></A></td>
41
<div class='online-navigation'>
44
42
<b class="navlabel">Previous:</b>
45
<a class="sectref" rel="prev" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn) </A>
43
<a class="sectref" rel="prev" href="pyapi-mpconn.html">4.5.5 Connection Object (mp_conn)</A>
46
44
<b class="navlabel">Up:</b>
47
<a class="sectref" rel="parent" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn) </A>
45
<a class="sectref" rel="parent" href="pyapi-mpconn.html">4.5.5 Connection Object (mp_conn)</A>
48
46
<b class="navlabel">Next:</b>
49
<a class="sectref" rel="next" href="pyapi-mpconn-mem.html">4.5.4.2 Connection Members</A>
47
<a class="sectref" rel="next" href="pyapi-mpconn-mem.html">4.5.5.2 Connection Members</A>
52
51
<!--End of Navigation Panel-->
54
<H3><A NAME="SECTION006541000000000000000"> </A>
53
<H3><A NAME="SECTION006551000000000000000"></A><A NAME="pyapi-mpconn-meth"></A>
56
4.5.4.1 Connection Methods
55
4.5.5.1 Connection Methods
60
59
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
61
<td><nobr><b><a name="l2h-131"><tt class="method">read</tt></a></b>(</nobr></td>
62
<td><big>[</big><var>length</var><big>]</big>)</td></tr></table>
60
<td><nobr><b><tt id='l2h-145' xml:id='l2h-145' class="method">log_error</tt></b>(</nobr></td>
61
<td><var>message</var><big>[</big><var>, level</var><big>]</big><var></var>)</td></tr></table></dt>
63
An interface to the Apache <code>ap_log_cerror</code>
64
function. <var>message</var> is a string with the error message,
65
<var>level</var> is one of the following flags constants:
68
<div class="verbatim"><pre>
81
If you need to write to log and do not have a reference to a connection or
82
request object, use the <tt class="function">apache.log_error</tt> function.
86
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
87
<td><nobr><b><tt id='l2h-146' xml:id='l2h-146' class="method">read</tt></b>(</nobr></td>
88
<td><var></var><big>[</big><var>length</var><big>]</big><var></var>)</td></tr></table></dt>
64
90
Reads at most <var>length</var> bytes from the client. The read blocks
65
91
indefinitely until there is at least one byte to read. If length is
83
109
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
84
<td><nobr><b><a name="l2h-132"><tt class="method">readline</tt></a></b>(</nobr></td>
85
<td><big>[</big><var>length</var><big>]</big>)</td></tr></table>
110
<td><nobr><b><tt id='l2h-147' xml:id='l2h-147' class="method">readline</tt></b>(</nobr></td>
111
<td><var></var><big>[</big><var>length</var><big>]</big><var></var>)</td></tr></table></dt>
89
115
Reads a line from the connection or up to <var>length</var> bytes.
92
This method should only be used inside <i>Connection Handlers</i>.
118
This method should only be used inside <em>Connection Handlers</em>.
98
124
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
99
<td><nobr><b><a name="l2h-133"><tt class="method">write</tt></a></b>(</nobr></td>
100
<td><var>string</var>)</td></tr></table>
125
<td><nobr><b><tt id='l2h-148' xml:id='l2h-148' class="method">write</tt></b>(</nobr></td>
126
<td><var>string</var>)</td></tr></table></dt>
104
130
Writes <var>string</var> to the client.
107
This method should only be used inside <i>Connection Handlers</i>.
133
This method should only be used inside <em>Connection Handlers</em>.
114
140
<DIV CLASS="navigation">
141
<div class='online-navigation'>
116
143
<table align="center" width="100%" cellpadding="0" cellspacing="2">
118
<td><a rel="prev" title="4.5.4 Connection Object (mp_conn) "
119
rel="prev" title="4.5.4 Connection Object (mp_conn) "
120
href="pyapi-mpconn.html"><img src='previous.gif'
121
border='0' height='32' alt='Previous Page' width='32'></A></td>
122
<td><a rel="parent" title="4.5.4 Connection Object (mp_conn) "
123
rel="parent" title="4.5.4 Connection Object (mp_conn) "
124
href="pyapi-mpconn.html"><img src='up.gif'
125
border='0' height='32' alt='Up One Level' width='32'></A></td>
126
<td><a rel="next" title="4.5.4.2 Connection Members"
127
rel="next" title="4.5.4.2 Connection Members"
128
href="pyapi-mpconn-mem.html"><img src='next.gif'
129
border='0' height='32' alt='Next Page' width='32'></A></td>
145
<td class='online-navigation'><a rel="prev" title="4.5.5 Connection Object (mp_conn)"
146
href="pyapi-mpconn.html"><img src='previous.png'
147
border='0' height='32' alt='Previous Page' width='32' /></A></td>
148
<td class='online-navigation'><a rel="parent" title="4.5.5 Connection Object (mp_conn)"
149
href="pyapi-mpconn.html"><img src='up.png'
150
border='0' height='32' alt='Up One Level' width='32' /></A></td>
151
<td class='online-navigation'><a rel="next" title="4.5.5.2 Connection Members"
152
href="pyapi-mpconn-mem.html"><img src='next.png'
153
border='0' height='32' alt='Next Page' width='32' /></A></td>
130
154
<td align="center" width="100%">Mod_python Manual</td>
131
<td><a rel="contents" title="Table of Contents"
132
rel="contents" title="Table of Contents"
133
href="contents.html"><img src='contents.gif'
134
border='0' height='32' alt='Contents' width='32'></A></td>
135
<td><img src='blank.gif'
136
border='0' height='32' alt='' width='32'></td>
137
<td><a rel="index" title="Index"
138
rel="index" title="Index"
139
href="genindex.html"><img src='index.gif'
140
border='0' height='32' alt='Index' width='32'></A></td>
155
<td class='online-navigation'><a rel="contents" title="Table of Contents"
156
href="contents.html"><img src='contents.png'
157
border='0' height='32' alt='Contents' width='32' /></A></td>
158
<td class='online-navigation'><img src='blank.png'
159
border='0' height='32' alt='' width='32' /></td>
160
<td class='online-navigation'><a rel="index" title="Index"
161
href="genindex.html"><img src='index.png'
162
border='0' height='32' alt='Index' width='32' /></A></td>
164
<div class='online-navigation'>
142
165
<b class="navlabel">Previous:</b>
143
<a class="sectref" rel="prev" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn) </A>
166
<a class="sectref" rel="prev" href="pyapi-mpconn.html">4.5.5 Connection Object (mp_conn)</A>
144
167
<b class="navlabel">Up:</b>
145
<a class="sectref" rel="parent" href="pyapi-mpconn.html">4.5.4 Connection Object (mp_conn) </A>
168
<a class="sectref" rel="parent" href="pyapi-mpconn.html">4.5.5 Connection Object (mp_conn)</A>
146
169
<b class="navlabel">Next:</b>
147
<a class="sectref" rel="next" href="pyapi-mpconn-mem.html">4.5.4.2 Connection Members</A>
149
<span class="release-info">Release 3.2.10, documentation updated on July 19, 2006.</span>
170
<a class="sectref" rel="next" href="pyapi-mpconn-mem.html">4.5.5.2 Connection Members</A>
174
<span class="release-info">Release 3.3.1, documentation updated on January 29, 2007.</span>
151
176
<!--End of Navigation Panel-->