ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / doc / html / gnome-vfs-20-gnome-vfs-socket.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gnome-vfs-socket</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
2         .synopsis, .classsynopsis {
3             background: #eeeeee;
4             border: solid 1px #aaaaaa;
5             padding: 0.5em;
6         }
7         .programlisting {
8             background: #eeeeff;
9             border: solid 1px #aaaaff;
10             padding: 0.5em;
11         }
12         .variablelist {
13             padding: 4px;
14             margin-left: 3em;
15         }
16         .navigation {
17             background: #ffeeee;
18             border: solid 1px #ffaaaa;
19             margin-top: 0.5em;
20             margin-bottom: 0.5em;
21         }
22         .navigation a {
23             color: #770000;
24         }
25         .navigation a:visited {
26             color: #550000;
27         }
28         .navigation .title {
29             font-size: 200%;
30         }
31       </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="modules.html" title="Filesystem Modules"><link rel="previous" href="gnome-vfs-20-gnome-vfs-context.html" title="GnomeVFSContext"><link rel="next" href="gnome-vfs-20-gnome-vfs-socket-buffer.html" title="gnome-vfs-socket-buffer"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="gnome-vfs-20-gnome-vfs-context.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="modules.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th><td><a accesskey="n" href="gnome-vfs-20-gnome-vfs-socket-buffer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gnome-vfs-20-gnome-vfs-socket"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">gnome-vfs-socket</span></h2><p>gnome-vfs-socket &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
32
33
34
35 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (<a href="gnome-vfs-20-gnome-vfs-socket.html#GnomeVFSSocketReadFunc">*GnomeVFSSocketReadFunc</a>)    (<a
36 href="../glib/glib-Basic-Types.html#gpointer"
37 >gpointer</a> connection,
38                                              <a
39 href="../glib/glib-Basic-Types.html#gpointer"
40 >gpointer</a> buffer,
41                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
42                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);
43 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (<a href="gnome-vfs-20-gnome-vfs-socket.html#GnomeVFSSocketWriteFunc">*GnomeVFSSocketWriteFunc</a>)   (<a
44 href="../glib/glib-Basic-Types.html#gpointer"
45 >gpointer</a> connection,
46                                              <a
47 href="../glib/glib-Basic-Types.html#gconstpointer"
48 >gconstpointer</a> buffer,
49                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
50                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);
51 void        (<a href="gnome-vfs-20-gnome-vfs-socket.html#GnomeVFSSocketCloseFunc">*GnomeVFSSocketCloseFunc</a>)      (<a
52 href="../glib/glib-Basic-Types.html#gpointer"
53 >gpointer</a> connection);
54 typedef     <a href="gnome-vfs-20-gnome-vfs-socket.html#GnomeVFSSocketImpl">GnomeVFSSocketImpl</a>;
55 GnomeVFSSocket* <a href="gnome-vfs-20-gnome-vfs-socket.html#gnome-vfs-socket-new">gnome_vfs_socket_new</a>        (<a href="gnome-vfs-20-gnome-vfs-socket.html#GnomeVFSSocketImpl">GnomeVFSSocketImpl</a> *impl,
56                                              void *connection);
57 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket.html#gnome-vfs-socket-write">gnome_vfs_socket_write</a>       (GnomeVFSSocket *socket,
58                                              <a
59 href="../glib/glib-Basic-Types.html#gconstpointer"
60 >gconstpointer</a> buffer,
61                                              int bytes,
62                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);
63 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket.html#gnome-vfs-socket-close">gnome_vfs_socket_close</a>       (GnomeVFSSocket *socket);
64 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-socket.html#gnome-vfs-socket-read">gnome_vfs_socket_read</a>        (GnomeVFSSocket *socket,
65                                              <a
66 href="../glib/glib-Basic-Types.html#gpointer"
67 >gpointer</a> buffer,
68                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
69                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);
70 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
71
72 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketReadFunc"></a>GnomeVFSSocketReadFunc ()</h3><a class="indexterm" name="id2985454"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (*GnomeVFSSocketReadFunc)    (<a
73 href="../glib/glib-Basic-Types.html#gpointer"
74 >gpointer</a> connection,
75                                              <a
76 href="../glib/glib-Basic-Types.html#gpointer"
77 >gpointer</a> buffer,
78                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
79                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);</pre><p>
80
81 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>connection</tt></i> :</span></td><td>
82 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td>
83 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td>
84 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_read</tt></i> :</span></td><td>
85 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
86
87
88 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketWriteFunc"></a>GnomeVFSSocketWriteFunc ()</h3><a class="indexterm" name="id2985613"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (*GnomeVFSSocketWriteFunc)   (<a
89 href="../glib/glib-Basic-Types.html#gpointer"
90 >gpointer</a> connection,
91                                              <a
92 href="../glib/glib-Basic-Types.html#gconstpointer"
93 >gconstpointer</a> buffer,
94                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
95                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);</pre><p>
96
97 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>connection</tt></i> :</span></td><td>
98 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td>
99 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td>
100 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_written</tt></i> :</span></td><td>
101 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
102
103
104 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketCloseFunc"></a>GnomeVFSSocketCloseFunc ()</h3><a class="indexterm" name="id2985774"></a><pre class="programlisting">void        (*GnomeVFSSocketCloseFunc)      (<a
105 href="../glib/glib-Basic-Types.html#gpointer"
106 >gpointer</a> connection);</pre><p>
107
108 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>connection</tt></i> :</span></td><td>
109
110
111 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketImpl"></a>GnomeVFSSocketImpl</h3><a class="indexterm" name="id2985842"></a><pre class="programlisting">typedef struct {
112   GnomeVFSSocketReadFunc read;
113   GnomeVFSSocketWriteFunc write;
114   GnomeVFSSocketCloseFunc close;
115 } GnomeVFSSocketImpl;
116 </pre><p>
117
118 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-new"></a>gnome_vfs_socket_new ()</h3><a class="indexterm" name="id2985877"></a><pre class="programlisting">GnomeVFSSocket* gnome_vfs_socket_new        (<a href="gnome-vfs-20-gnome-vfs-socket.html#GnomeVFSSocketImpl">GnomeVFSSocketImpl</a> *impl,
119                                              void *connection);</pre><p>
120 Creates a new GnomeVFS Socket using the specific implementation
121 <i class="parameter"><tt>impl</tt></i>.</p><p>
122
123 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>impl</tt></i> :</span></td><td> an implementation of a socket, e.g. GnomeVFSSSL
124 </td></tr><tr><td><span class="term"><i class="parameter"><tt>connection</tt></i> :</span></td><td> pointer to a connection object used by <i class="parameter"><tt>impl</tt></i> to track
125 state (the exact nature of <i class="parameter"><tt>connection</tt></i> varies from implementation to
126 implementation)
127 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly created socket
128 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-write"></a>gnome_vfs_socket_write ()</h3><a class="indexterm" name="id2986014"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_write       (GnomeVFSSocket *socket,
129                                              <a
130 href="../glib/glib-Basic-Types.html#gconstpointer"
131 >gconstpointer</a> buffer,
132                                              int bytes,
133                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);</pre><p>
134 Write <i class="parameter"><tt>bytes</tt></i> bytes of data from <i class="parameter"><tt>buffer</tt></i> to <i class="parameter"><tt>socket</tt></i>.</p><p>
135
136 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket</tt></i> :</span></td><td> socket to write data to
137 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> data to write to the socket
138 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td> number of bytes from <i class="parameter"><tt>buffer</tt></i> to write to <i class="parameter"><tt>socket</tt></i>
139 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_written</tt></i> :</span></td><td> pointer to a GnomeVFSFileSize, will contain
140 the number of bytes actually written to the socket on return.
141 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
142 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-close"></a>gnome_vfs_socket_close ()</h3><a class="indexterm" name="id2986217"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_close       (GnomeVFSSocket *socket);</pre><p>
143 Close <i class="parameter"><tt>socket</tt></i>, freeing any resources it may be using.</p><p>
144
145 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket</tt></i> :</span></td><td> the socket to be closed
146 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
147 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-read"></a>gnome_vfs_socket_read ()</h3><a class="indexterm" name="id2986312"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_read        (GnomeVFSSocket *socket,
148                                              <a
149 href="../glib/glib-Basic-Types.html#gpointer"
150 >gpointer</a> buffer,
151                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
152                                              <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);</pre><p>
153 Read <i class="parameter"><tt>bytes</tt></i> bytes of data from the <i class="parameter"><tt>socket</tt></i> into <i class="parameter"><tt>buffer</tt></i>.</p><p>
154
155 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>socket</tt></i> :</span></td><td> socket to read data from
156 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> allocated buffer of at least <i class="parameter"><tt>bytes</tt></i> bytes to be read into
157 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td> number of bytes to read from <i class="parameter"><tt>socket</tt></i> into <i class="parameter"><tt>buffer</tt></i>
158 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_read</tt></i> :</span></td><td> pointer to a GnomeVFSFileSize, will contain
159 the number of bytes actually read from the socket on return.
160 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
161 </td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="gnome-vfs-20-gnome-vfs-context.html"><b>&lt;&lt; GnomeVFSContext</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-20-gnome-vfs-socket-buffer.html"><b>gnome-vfs-socket-buffer &gt;&gt;</b></a></td></tr></table></body></html>