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-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-gnome-vfs-context.html" title="
32 GnomeVFSContext"><link rel="next" href="gnome-vfs-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-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-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-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">
33
34
35
36 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (<a href="gnome-vfs-gnome-vfs-socket.html#GnomeVFSSocketReadFunc">*GnomeVFSSocketReadFunc</a>)    (<a
37 href="../glib/glib-Basic-Types.html#gpointer"
38 >gpointer</a> connection,
39                                              <a
40 href="../glib/glib-Basic-Types.html#gpointer"
41 >gpointer</a> buffer,
42                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
43                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);
44 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (<a href="gnome-vfs-gnome-vfs-socket.html#GnomeVFSSocketWriteFunc">*GnomeVFSSocketWriteFunc</a>)   (<a
45 href="../glib/glib-Basic-Types.html#gpointer"
46 >gpointer</a> connection,
47                                              <a
48 href="../glib/glib-Basic-Types.html#gconstpointer"
49 >gconstpointer</a> buffer,
50                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
51                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);
52 void        (<a href="gnome-vfs-gnome-vfs-socket.html#GnomeVFSSocketCloseFunc">*GnomeVFSSocketCloseFunc</a>)      (<a
53 href="../glib/glib-Basic-Types.html#gpointer"
54 >gpointer</a> connection);
55 typedef     <a href="gnome-vfs-gnome-vfs-socket.html#GnomeVFSSocketImpl">GnomeVFSSocketImpl</a>;
56 GnomeVFSSocket* <a href="gnome-vfs-gnome-vfs-socket.html#gnome-vfs-socket-new">gnome_vfs_socket_new</a>        (<a href="gnome-vfs-gnome-vfs-socket.html#GnomeVFSSocketImpl">GnomeVFSSocketImpl</a> *impl,
57                                              void *connection);
58 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-socket.html#gnome-vfs-socket-write">gnome_vfs_socket_write</a>       (GnomeVFSSocket *socket,
59                                              <a
60 href="../glib/glib-Basic-Types.html#gconstpointer"
61 >gconstpointer</a> buffer,
62                                              int bytes,
63                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);
64 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-socket.html#gnome-vfs-socket-close">gnome_vfs_socket_close</a>       (GnomeVFSSocket *socket);
65 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-socket.html#gnome-vfs-socket-read">gnome_vfs_socket_read</a>        (GnomeVFSSocket *socket,
66                                              <a
67 href="../glib/glib-Basic-Types.html#gpointer"
68 >gpointer</a> buffer,
69                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
70                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);
71 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
72
73 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketReadFunc"></a>GnomeVFSSocketReadFunc ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (*GnomeVFSSocketReadFunc)    (<a
74 href="../glib/glib-Basic-Types.html#gpointer"
75 >gpointer</a> connection,
76                                              <a
77 href="../glib/glib-Basic-Types.html#gpointer"
78 >gpointer</a> buffer,
79                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
80                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);</pre><p>
81
82 </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>
83 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td>
84 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td>
85 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_read</tt></i> :</span></td><td>
86 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
87
88
89 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketWriteFunc"></a>GnomeVFSSocketWriteFunc ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> (*GnomeVFSSocketWriteFunc)   (<a
90 href="../glib/glib-Basic-Types.html#gpointer"
91 >gpointer</a> connection,
92                                              <a
93 href="../glib/glib-Basic-Types.html#gconstpointer"
94 >gconstpointer</a> buffer,
95                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
96                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);</pre><p>
97
98 </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>
99 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td>
100 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td>
101 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_written</tt></i> :</span></td><td>
102 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
103
104
105 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketCloseFunc"></a>GnomeVFSSocketCloseFunc ()</h3><pre class="programlisting">void        (*GnomeVFSSocketCloseFunc)      (<a
106 href="../glib/glib-Basic-Types.html#gpointer"
107 >gpointer</a> connection);</pre><p>
108
109 </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>
110
111
112 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSSocketImpl"></a>GnomeVFSSocketImpl</h3><pre class="programlisting">typedef struct {
113   GnomeVFSSocketReadFunc read;
114   GnomeVFSSocketWriteFunc write;
115   GnomeVFSSocketCloseFunc close;
116 } GnomeVFSSocketImpl;
117 </pre><p>
118
119 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-socket-new"></a>gnome_vfs_socket_new ()</h3><pre class="programlisting">GnomeVFSSocket* gnome_vfs_socket_new        (<a href="gnome-vfs-gnome-vfs-socket.html#GnomeVFSSocketImpl">GnomeVFSSocketImpl</a> *impl,
120                                              void *connection);</pre><p>
121 Creates a new GnomeVFS Socket using the specific implementation
122 <i class="parameter"><tt>impl</tt></i>.</p><p>
123
124 </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
125 </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
126 state (the exact nature of <i class="parameter"><tt>connection</tt></i> varies from implementation to
127 implementation)
128 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a newly created socket
129 </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><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_write       (GnomeVFSSocket *socket,
130                                              <a
131 href="../glib/glib-Basic-Types.html#gconstpointer"
132 >gconstpointer</a> buffer,
133                                              int bytes,
134                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_written);</pre><p>
135 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>
136
137 </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
138 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> data to write to the socket
139 </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>
140 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_written</tt></i> :</span></td><td> pointer to a GnomeVFSFileSize, will contain
141 the number of bytes actually written to the socket on return.
142 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
143 </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><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_close       (GnomeVFSSocket *socket);</pre><p>
144 Close <i class="parameter"><tt>socket</tt></i>, freeing any resources it may be using.</p><p>
145
146 </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
147 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
148 </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><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_socket_read        (GnomeVFSSocket *socket,
149                                              <a
150 href="../glib/glib-Basic-Types.html#gpointer"
151 >gpointer</a> buffer,
152                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes,
153                                              <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> *bytes_read);</pre><p>
154 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>
155
156 </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
157 </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
158 </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>
159 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_read</tt></i> :</span></td><td> pointer to a GnomeVFSFileSize, will contain
160 the number of bytes actually read from the socket on return.
161 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> GnomeVFSResult indicating the success of the operation
162 </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-gnome-vfs-context.html"><b>&lt;&lt; 
163 GnomeVFSContext</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-gnome-vfs-socket-buffer.html"><b>gnome-vfs-socket-buffer &gt;&gt;</b></a></td></tr></table></body></html>