1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>Unified bufferd network I/O</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
7
<link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library">
8
<link rel="up" href="networking.html" title="Networking">
9
<link rel="prev" href="gnome-vfs-2.0-gnome-vfs-socket.html" title="Unified network I/O">
10
<link rel="next" href="gnome-vfs-2.0-gnome-vfs-inet-connection.html" title="Internet connection">
11
<meta name="generator" content="GTK-Doc V1.12 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="about.html" title="Introduction to GnomeVFS">
14
<link rel="chapter" href="data-types.html" title="Basic Data Types">
15
<link rel="chapter" href="gnome-vfs-basic-file-ops.html" title="File Operations">
16
<link rel="chapter" href="gnome-vfs-directory-ops.html" title="Directory-Specific Operations">
17
<link rel="chapter" href="gnome-vfs-file-and-dirs-ops.html" title="Advanced File/Directory Operations">
18
<link rel="chapter" href="gnome-vfs-file-async-ops.html" title="Asynchronous Operations">
19
<link rel="chapter" href="volumes.html" title="Volumes and Drives Handling">
20
<link rel="chapter" href="networking.html" title="Networking">
21
<link rel="chapter" href="mime-registry.html" title="MIME Registry">
22
<link rel="chapter" href="modules.html" title="Filesystem Modules">
24
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
27
<td><a accesskey="p" href="gnome-vfs-2.0-gnome-vfs-socket.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
<td><a accesskey="u" href="networking.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
29
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
30
<th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th>
31
<td><a accesskey="n" href="gnome-vfs-2.0-gnome-vfs-inet-connection.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
33
<tr><td colspan="5" class="shortcuts">
34
<a href="#gnome-vfs-2.0-gnome-vfs-socket-buffer.synopsis" class="shortcut">Top</a>
36
<a href="#gnome-vfs-2.0-gnome-vfs-socket-buffer.description" class="shortcut">Description</a>
39
<div class="refentry" lang="en">
40
<a name="gnome-vfs-2.0-gnome-vfs-socket-buffer"></a><div class="titlepage"></div>
41
<div class="refnamediv"><table width="100%"><tr>
43
<h2><span class="refentrytitle"><a name="gnome-vfs-2.0-gnome-vfs-socket-buffer.top_of_page"></a>Unified bufferd network I/O</span></h2>
44
<p>Unified bufferd network I/O — Posix style buffered network input/output.</p>
46
<td valign="top" align="right"></td>
48
<div class="refsynopsisdiv">
49
<a name="gnome-vfs-2.0-gnome-vfs-socket-buffer.synopsis"></a><h2>Synopsis</h2>
50
<pre class="synopsis">
51
typedef <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a>;
52
<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a>* <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-new" title="gnome_vfs_socket_buffer_new ()">gnome_vfs_socket_buffer_new</a> (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket.html#GnomeVFSSocket" title="GnomeVFSSocket">GnomeVFSSocket</a> *socket);
53
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-destroy" title="gnome_vfs_socket_buffer_destroy ()">gnome_vfs_socket_buffer_destroy</a> (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
54
gboolean close_socket,
55
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);
56
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-read" title="gnome_vfs_socket_buffer_read ()">gnome_vfs_socket_buffer_read</a> (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
58
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
59
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read,
60
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);
61
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-peekc" title="gnome_vfs_socket_buffer_peekc ()">gnome_vfs_socket_buffer_peekc</a> (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
63
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);
64
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-write" title="gnome_vfs_socket_buffer_write ()">gnome_vfs_socket_buffer_write</a> (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
66
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
67
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written,
68
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);
69
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-flush" title="gnome_vfs_socket_buffer_flush ()">gnome_vfs_socket_buffer_flush</a> (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
70
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);
71
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-read-until" title="gnome_vfs_socket_buffer_read_until ()">gnome_vfs_socket_buffer_read_until</a> (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
73
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
74
gconstpointer boundary,
75
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> boundary_len,
76
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read,
77
gboolean *got_boundary,
78
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);
81
<div class="refsect1" lang="en">
82
<a name="gnome-vfs-2.0-gnome-vfs-socket-buffer.description"></a><h2>Description</h2>
84
The GnomeVFSSocketBuffer functions are very similar to the GnomeVFSSocket
85
ones. The only difference is that all input/output is done through an internally
86
managed buffer. This might increase I/O performance as well as give you the
87
possibility to use some convenient functions like <a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#gnome-vfs-socket-buffer-peekc" title="gnome_vfs_socket_buffer_peekc ()"><span class="type">gnome_vfs_socket_buffer_peekc</span></a>
88
and <span class="type">gnome_vfs_socket_buffer_read_until.</span>
93
You can manually force all internally buffered data to get written with
94
<span class="type">gnome_vfs_socket_buffer_flush.</span>
97
<div class="refsect1" lang="en">
98
<a name="gnome-vfs-2.0-gnome-vfs-socket-buffer.details"></a><h2>Details</h2>
99
<div class="refsect2" lang="en">
100
<a name="GnomeVFSSocketBuffer"></a><h3>GnomeVFSSocketBuffer</h3>
101
<pre class="programlisting">typedef struct GnomeVFSSocketBuffer GnomeVFSSocketBuffer;
104
A handle to a socket buffer. A socket buffer is a temporary in-memory storage for data
105
that is read from or written to a <span class="type">GnomeVFSSocket.</span></p>
110
<div class="refsect2" lang="en">
111
<a name="gnome-vfs-socket-buffer-new"></a><h3>gnome_vfs_socket_buffer_new ()</h3>
112
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a>* gnome_vfs_socket_buffer_new (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket.html#GnomeVFSSocket" title="GnomeVFSSocket">GnomeVFSSocket</a> *socket);</pre>
114
Create a socket buffer around <em class="parameter"><code>socket</code></em>. A buffered
115
socket allows data to be poked at without reading it
116
as it will be buffered. A future read will retrieve
120
<div class="variablelist"><table border="0">
121
<col align="left" valign="top">
124
<td><p><span class="term"><em class="parameter"><code>socket</code></em> :</span></p></td>
125
<td> socket to be buffered.
129
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
130
<td> a newly allocated <span class="type">GnomeVFSSocketBuffer.</span>
137
<div class="refsect2" lang="en">
138
<a name="gnome-vfs-socket-buffer-destroy"></a><h3>gnome_vfs_socket_buffer_destroy ()</h3>
139
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_destroy (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
140
gboolean close_socket,
141
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);</pre>
143
Free the socket buffer.</p>
146
<div class="variablelist"><table border="0">
147
<col align="left" valign="top">
150
<td><p><span class="term"><em class="parameter"><code>socket_buffer</code></em> :</span></p></td>
151
<td> buffered socket to destroy.
155
<td><p><span class="term"><em class="parameter"><code>close_socket</code></em> :</span></p></td>
156
<td> if <code class="literal">TRUE</code>, the socket being buffered will be closed.
160
<td><p><span class="term"><em class="parameter"><code>cancellation</code></em> :</span></p></td>
161
<td> handle allowing cancellation of the operation.
165
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
166
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult"><span class="type">GnomeVFSResult</span></a> indicating the success of the operation.
173
<div class="refsect2" lang="en">
174
<a name="gnome-vfs-socket-buffer-read"></a><h3>gnome_vfs_socket_buffer_read ()</h3>
175
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_read (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
177
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
178
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read,
179
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);</pre>
181
Read <em class="parameter"><code>bytes</code></em> bytes of data from the <em class="parameter"><code>socket</code></em> into <em class="parameter"><code>socket_buffer</code></em>.</p>
184
<div class="variablelist"><table border="0">
185
<col align="left" valign="top">
188
<td><p><span class="term"><em class="parameter"><code>socket_buffer</code></em> :</span></p></td>
189
<td> buffered socket to read data from.
193
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
194
<td> allocated buffer of at least <em class="parameter"><code>bytes</code></em> bytes to be read into.
198
<td><p><span class="term"><em class="parameter"><code>bytes</code></em> :</span></p></td>
199
<td> number of bytes to read from <em class="parameter"><code>socket_buffer</code></em> into <em class="parameter"><code>buffer</code></em>.
203
<td><p><span class="term"><em class="parameter"><code>bytes_read</code></em> :</span></p></td>
204
<td> pointer to a <a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize"><span class="type">GnomeVFSFileSize</span></a>, will contain
205
the number of bytes actually read from the <em class="parameter"><code>socket_buffer</code></em> on return.
209
<td><p><span class="term"><em class="parameter"><code>cancellation</code></em> :</span></p></td>
210
<td> handle allowing cancellation of the operation.
214
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
215
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult"><span class="type">GnomeVFSResult</span></a> indicating the success of the operation.
222
<div class="refsect2" lang="en">
223
<a name="gnome-vfs-socket-buffer-peekc"></a><h3>gnome_vfs_socket_buffer_peekc ()</h3>
224
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_peekc (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
226
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);</pre>
228
Peek at the next character in <em class="parameter"><code>socket_buffer</code></em> without actually reading
229
the character in. The next read will retrieve <em class="parameter"><code>c</code></em> (as well as any following
230
data if requested).</p>
233
<div class="variablelist"><table border="0">
234
<col align="left" valign="top">
237
<td><p><span class="term"><em class="parameter"><code>socket_buffer</code></em> :</span></p></td>
238
<td> the socket buffer to read from.
242
<td><p><span class="term"><em class="parameter"><code>character</code></em> :</span></p></td>
243
<td> pointer to a char, will contain a character on return from
248
<td><p><span class="term"><em class="parameter"><code>cancellation</code></em> :</span></p></td>
249
<td> handle allowing cancellation of the operation.
253
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
254
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult"><span class="type">GnomeVFSResult</span></a> indicating the success of the operation.
261
<div class="refsect2" lang="en">
262
<a name="gnome-vfs-socket-buffer-write"></a><h3>gnome_vfs_socket_buffer_write ()</h3>
263
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_write (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
264
gconstpointer buffer,
265
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
266
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written,
267
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);</pre>
269
Write <em class="parameter"><code>bytes</code></em> bytes of data from <em class="parameter"><code>buffer</code></em> to <em class="parameter"><code>socket_buffer</code></em>.</p>
272
<div class="variablelist"><table border="0">
273
<col align="left" valign="top">
276
<td><p><span class="term"><em class="parameter"><code>socket_buffer</code></em> :</span></p></td>
277
<td> buffered socket to write data to.
281
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
282
<td> data to write to the <em class="parameter"><code>socket_buffer</code></em>.
286
<td><p><span class="term"><em class="parameter"><code>bytes</code></em> :</span></p></td>
287
<td> number of bytes to write from <em class="parameter"><code>buffer</code></em> to <em class="parameter"><code>socket_buffer</code></em>.
291
<td><p><span class="term"><em class="parameter"><code>bytes_written</code></em> :</span></p></td>
292
<td> pointer to a <a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize"><span class="type">GnomeVFSFileSize</span></a>, will contain
293
the number of bytes actually written to the <em class="parameter"><code>socket_buffer</code></em> on return.
297
<td><p><span class="term"><em class="parameter"><code>cancellation</code></em> :</span></p></td>
298
<td> handle allowing cancellation of the operation.
302
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
303
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult"><span class="type">GnomeVFSResult</span></a> indicating the success of the operation.
310
<div class="refsect2" lang="en">
311
<a name="gnome-vfs-socket-buffer-flush"></a><h3>gnome_vfs_socket_buffer_flush ()</h3>
312
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_flush (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
313
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);</pre>
315
Write all outstanding data to <em class="parameter"><code>socket_buffer</code></em>.</p>
318
<div class="variablelist"><table border="0">
319
<col align="left" valign="top">
322
<td><p><span class="term"><em class="parameter"><code>socket_buffer</code></em> :</span></p></td>
323
<td> buffer to flush.
327
<td><p><span class="term"><em class="parameter"><code>cancellation</code></em> :</span></p></td>
328
<td> handle allowing cancellation of the operation.
332
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
333
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult"><span class="type">GnomeVFSResult</span></a> indicating the success of the operation.
340
<div class="refsect2" lang="en">
341
<a name="gnome-vfs-socket-buffer-read-until"></a><h3>gnome_vfs_socket_buffer_read_until ()</h3>
342
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_buffer_read_until (<a class="link" href="gnome-vfs-2.0-gnome-vfs-socket-buffer.html#GnomeVFSSocketBuffer" title="GnomeVFSSocketBuffer">GnomeVFSSocketBuffer</a> *socket_buffer,
344
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
345
gconstpointer boundary,
346
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> boundary_len,
347
<a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read,
348
gboolean *got_boundary,
349
<a class="link" href="gnome-vfs-2.0-gnome-vfs-async-ops.html#GnomeVFSCancellation" title="GnomeVFSCancellation">GnomeVFSCancellation</a> *cancellation);</pre>
351
Read up to <em class="parameter"><code>bytes</code></em> bytes of data from the <em class="parameter"><code>socket_buffer</code></em> into <em class="parameter"><code>buffer</code></em>
352
until boundary is reached. <em class="parameter"><code>got_boundary</code></em> will be set accordingly.
355
Note that if <em class="parameter"><code>bytes</code></em> is smaller than <em class="parameter"><code>boundary_len</code></em> there is no way
356
to detected the boundary! So if you want to make sure that every boundary
357
is found (in a loop maybe) assure that <em class="parameter"><code>bytes</code></em> is at least as big as
358
<em class="parameter"><code>boundary_len</code></em>.</p>
361
<div class="variablelist"><table border="0">
362
<col align="left" valign="top">
365
<td><p><span class="term"><em class="parameter"><code>socket_buffer</code></em> :</span></p></td>
366
<td> buffered socket to read data from.
370
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
371
<td> allocated buffer of at least <em class="parameter"><code>bytes</code></em> bytes to be read into.
375
<td><p><span class="term"><em class="parameter"><code>bytes</code></em> :</span></p></td>
376
<td> maximum number of bytes to read from <em class="parameter"><code>socket_buffer</code></em> into <em class="parameter"><code>buffer</code></em>.
380
<td><p><span class="term"><em class="parameter"><code>boundary</code></em> :</span></p></td>
381
<td> the boundary until which is read.
385
<td><p><span class="term"><em class="parameter"><code>boundary_len</code></em> :</span></p></td>
386
<td> the length of the <em class="parameter"><code>boundary</code></em>.
390
<td><p><span class="term"><em class="parameter"><code>bytes_read</code></em> :</span></p></td>
391
<td> pointer to a <a class="link" href="gnome-vfs-2.0-gnome-vfs-file-size.html#GnomeVFSFileSize" title="GnomeVFSFileSize"><span class="type">GnomeVFSFileSize</span></a>, will contain
392
the number of bytes actually read from the <em class="parameter"><code>socket_buffer</code></em> on return.
396
<td><p><span class="term"><em class="parameter"><code>got_boundary</code></em> :</span></p></td>
397
<td> pointer to a <span class="type">gboolean</span> which will be <code class="literal">TRUE</code> if the boundary
398
was found or <code class="literal">FALSE</code> otherwise.
402
<td><p><span class="term"><em class="parameter"><code>cancellation</code></em> :</span></p></td>
403
<td> handle allowing cancellation of the operation.
407
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
408
<td> <a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult"><span class="type">GnomeVFSResult</span></a> indicating the success of the operation.
414
<p class="since">Since 2.8</p>
420
Generated by GTK-Doc V1.12</div>