| GnomeVFS - Filesystem Abstraction library |
|---|
gnome-vfs-socket —
GnomeVFSResult (*GnomeVFSSocketReadFunc) (gpointer connection, gpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_read, GnomeVFSCancellation *cancellation); GnomeVFSResult (*GnomeVFSSocketWriteFunc) (gpointer connection, gconstpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_written, GnomeVFSCancellation *cancellation); void (*GnomeVFSSocketCloseFunc) (gpointer connection, GnomeVFSCancellation *cancellation); typedef GnomeVFSSocketImpl; GnomeVFSSocket* gnome_vfs_socket_new (GnomeVFSSocketImpl *impl, void *connection); GnomeVFSResult gnome_vfs_socket_write (GnomeVFSSocket *socket, gconstpointer buffer, int bytes, GnomeVFSFileSize *bytes_written, GnomeVFSCancellation *cancellation); GnomeVFSResult gnome_vfs_socket_close (GnomeVFSSocket *socket, GnomeVFSCancellation *cancellation); GnomeVFSResult gnome_vfs_socket_read (GnomeVFSSocket *socket, gpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_read, GnomeVFSCancellation *cancellation);
GnomeVFSResult (*GnomeVFSSocketReadFunc) (gpointer connection, gpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_read, GnomeVFSCancellation *cancellation);
| connection : | |
| buffer : | |
| bytes : | |
| bytes_read : | |
| cancellation : | |
| Returns : |
GnomeVFSResult (*GnomeVFSSocketWriteFunc) (gpointer connection, gconstpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_written, GnomeVFSCancellation *cancellation);
| connection : | |
| buffer : | |
| bytes : | |
| bytes_written : | |
| cancellation : | |
| Returns : |
void (*GnomeVFSSocketCloseFunc) (gpointer connection, GnomeVFSCancellation *cancellation);
| connection : | |
| cancellation : |
typedef struct {
GnomeVFSSocketReadFunc read;
GnomeVFSSocketWriteFunc write;
GnomeVFSSocketCloseFunc close;
GnomeVFSSocketSetTimeoutFunc set_timeout;
} GnomeVFSSocketImpl;
GnomeVFSSocket* gnome_vfs_socket_new (GnomeVFSSocketImpl *impl, void *connection);
Creates a new GnomeVFS Socket using the specific implementation impl.
| impl : | an implementation of a socket, e.g. GnomeVFSSSL |
| connection : | pointer to a connection object used by impl to track state (the exact nature of connection varies from implementation to implementation) |
| Returns : | a newly created socket |
GnomeVFSResult gnome_vfs_socket_write (GnomeVFSSocket *socket, gconstpointer buffer, int bytes, GnomeVFSFileSize *bytes_written, GnomeVFSCancellation *cancellation);
Write bytes bytes of data from buffer to socket.
| socket : | socket to write data to |
| buffer : | data to write to the socket |
| bytes : | number of bytes from buffer to write to socket |
| bytes_written : | pointer to a GnomeVFSFileSize, will contain the number of bytes actually written to the socket on return. |
| cancellation : | optional cancellation object |
| Returns : | GnomeVFSResult indicating the success of the operation |
GnomeVFSResult gnome_vfs_socket_close (GnomeVFSSocket *socket, GnomeVFSCancellation *cancellation);
Close socket, freeing any resources it may be using.
| socket : | the socket to be closed |
| cancellation : | optional cancellation object |
| Returns : | GnomeVFSResult indicating the success of the operation |
GnomeVFSResult gnome_vfs_socket_read (GnomeVFSSocket *socket, gpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_read, GnomeVFSCancellation *cancellation);
Read bytes bytes of data from the socket into buffer.
| socket : | socket to read data from |
| buffer : | allocated buffer of at least bytes bytes to be read into |
| bytes : | number of bytes to read from socket into buffer |
| bytes_read : | pointer to a GnomeVFSFileSize, will contain the number of bytes actually read from the socket on return. |
| cancellation : | optional cancellation object |
| Returns : | GnomeVFSResult indicating the success of the operation |
| << GnomeVFSContext | gnome-vfs-socket-buffer >> |