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 {
4 border: solid 1px #aaaaaa;
9 border: solid 1px #aaaaff;
18 border: solid 1px #ffaaaa;
25 .navigation a:visited {
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 — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
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,
40 href="../glib/glib-Basic-Types.html#gpointer"
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,
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,
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,
60 href="../glib/glib-Basic-Types.html#gconstpointer"
61 >gconstpointer</a> buffer,
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,
67 href="../glib/glib-Basic-Types.html#gpointer"
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>
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,
77 href="../glib/glib-Basic-Types.html#gpointer"
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>
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>
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,
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>
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>
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>
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>
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;
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>
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
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,
131 href="../glib/glib-Basic-Types.html#gconstpointer"
132 >gconstpointer</a> buffer,
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>
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>
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,
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>
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><<
163 GnomeVFSContext</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-gnome-vfs-socket-buffer.html"><b>gnome-vfs-socket-buffer >></b></a></td></tr></table></body></html>