GnomeVFS - Filesystem Abstraction library | ||||
---|---|---|---|---|
Top | Description |
Synopsis
typedef GnomeVFSInetConnection; GnomeVFSResult gnome_vfs_inet_connection_create (GnomeVFSInetConnection **connection_return, const gchar *host_name, guint host_port, GnomeVFSCancellation *cancellation); void gnome_vfs_inet_connection_destroy (GnomeVFSInetConnection *connection, GnomeVFSCancellation *cancellation); void gnome_vfs_inet_connection_free (GnomeVFSInetConnection *connection, GnomeVFSCancellation *cancellation); GnomeVFSSocket * gnome_vfs_inet_connection_to_socket (GnomeVFSInetConnection *connection); GnomeVFSSocketBuffer * gnome_vfs_inet_connection_to_socket_buffer (GnomeVFSInetConnection *connection); int gnome_vfs_inet_connection_get_fd (GnomeVFSInetConnection *connection); GnomeVFSResult gnome_vfs_inet_connection_create_from_address (GnomeVFSInetConnection **connection_return, GnomeVFSAddress *address, guint host_port, GnomeVFSCancellation *cancellation); GnomeVFSAddress * gnome_vfs_inet_connection_get_address (GnomeVFSInetConnection *connection); char * gnome_vfs_inet_connection_get_ip (GnomeVFSInetConnection *connection);
Description
A GnomeVFSInetConnection represents a TCP/IP connection. You can either use gnome_vfs_inet_connection_create which will use the gnome_vfs_resolve DNS resolution functions internally or you can do the name resolution yourself and use gnome_vfs_inet_connection_create_from_address to connect to a specific address. After a connection has been established all I/O is done through a GnomeVFSSocket or a GnomeVFSSocketBuffer.
Details
gnome_vfs_inet_connection_create ()
GnomeVFSResult gnome_vfs_inet_connection_create (GnomeVFSInetConnection **connection_return, const gchar *host_name, guint host_port, GnomeVFSCancellation *cancellation);
Creates a connection at connection_return
to host_name
using
port port
.
|
pointer to a pointer to a GnomeVFSInetConnection, which will contain an allocated GnomeVFSInetConnection object on return. |
|
string indicating the host to establish an internet connection with. |
|
port number to connect to. |
|
handle allowing cancellation of the operation. |
Returns : |
GnomeVFSResult indicating the success of the operation. |
gnome_vfs_inet_connection_destroy ()
void gnome_vfs_inet_connection_destroy (GnomeVFSInetConnection *connection, GnomeVFSCancellation *cancellation);
Closes/Destroys connection
.
|
connection to destroy. |
|
handle for cancelling the operation. |
gnome_vfs_inet_connection_free ()
void gnome_vfs_inet_connection_free (GnomeVFSInetConnection *connection, GnomeVFSCancellation *cancellation);
Frees connection
without closing the socket.
|
connection to free. |
|
handle for cancelling the operation. |
gnome_vfs_inet_connection_to_socket ()
GnomeVFSSocket * gnome_vfs_inet_connection_to_socket (GnomeVFSInetConnection *connection);
Wrap connection
inside a standard GnomeVFSSocket for convenience.
|
connection to be wrapped into a GnomeVFSSocket. |
Returns : |
a newly created GnomeVFSSocket around connection .
|
gnome_vfs_inet_connection_to_socket_buffer ()
GnomeVFSSocketBuffer * gnome_vfs_inet_connection_to_socket_buffer (GnomeVFSInetConnection *connection);
Wrap connection
inside a standard GnomeVFSSocketBuffer for convenience.
|
connection to be wrapped into a GnomeVFSSocketBuffer. |
Returns : |
a newly created GnomeVFSSocketBuffer around connection .
|
gnome_vfs_inet_connection_get_fd ()
int gnome_vfs_inet_connection_get_fd (GnomeVFSInetConnection *connection);
Retrieve the UNIX file descriptor corresponding to connection
.
|
connection to get the file descriptor from. |
Returns : |
file descriptor. |
gnome_vfs_inet_connection_create_from_address ()
GnomeVFSResult gnome_vfs_inet_connection_create_from_address (GnomeVFSInetConnection **connection_return, GnomeVFSAddress *address, guint host_port, GnomeVFSCancellation *cancellation);
Creates a connection at connection_return
to address
using
port port
.
|
pointer to a pointer to a GnomeVFSInetConnection, which will contain an allocated GnomeVFSInetConnection object on return. |
|
a valid GnomeVFSAddress. |
|
port number to connect to. |
|
handle allowing cancellation of the operation. |
Returns : |
GnomeVFSResult indicating the success of the operation. |
Since 2.8
gnome_vfs_inet_connection_get_address ()
GnomeVFSAddress * gnome_vfs_inet_connection_get_address (GnomeVFSInetConnection *connection);
Retrieve the address of the other side of a connected connection
.
|
connection to get the address from. |
Returns : |
a GnomeVFSAddress containing the address. Since 2.8 |
gnome_vfs_inet_connection_get_ip ()
char * gnome_vfs_inet_connection_get_ip (GnomeVFSInetConnection *connection);
Retrieve the ip address of the other side of a connected connection
.
|
connection to get the ip from. |
Returns : |
string version of the ip. |
Since 2.8