![]() |
![]() |
![]() |
MateVFS - Filesystem Abstraction library | ![]() |
---|---|---|---|---|
Top | Description |
typedef MateVFSInetConnection; MateVFSResult mate_vfs_inet_connection_create (MateVFSInetConnection **connection_return
,const gchar *host_name
,guint host_port
,MateVFSCancellation *cancellation
); void mate_vfs_inet_connection_destroy (MateVFSInetConnection *connection
,MateVFSCancellation *cancellation
); void mate_vfs_inet_connection_free (MateVFSInetConnection *connection
,MateVFSCancellation *cancellation
); MateVFSSocket * mate_vfs_inet_connection_to_socket (MateVFSInetConnection *connection
); MateVFSSocketBuffer * mate_vfs_inet_connection_to_socket_buffer (MateVFSInetConnection *connection
); int mate_vfs_inet_connection_get_fd (MateVFSInetConnection *connection
); MateVFSResult mate_vfs_inet_connection_create_from_address (MateVFSInetConnection **connection_return
,MateVFSAddress *address
,guint host_port
,MateVFSCancellation *cancellation
); MateVFSAddress * mate_vfs_inet_connection_get_address (MateVFSInetConnection *connection
); char * mate_vfs_inet_connection_get_ip (MateVFSInetConnection *connection
);
A MateVFSInetConnection represents a TCP/IP connection. You can either use mate_vfs_inet_connection_create which will use the mate_vfs_resolve DNS resolution functions internally or you can do the name resolution yourself and use mate_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 MateVFSSocket or a MateVFSSocketBuffer.
MateVFSResult mate_vfs_inet_connection_create (MateVFSInetConnection **connection_return
,const gchar *host_name
,guint host_port
,MateVFSCancellation *cancellation
);
Creates a connection at connection_return
to host_name
using
port port
.
|
pointer to a pointer to a MateVFSInetConnection, which will contain an allocated MateVFSInetConnection 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 : |
MateVFSResult indicating the success of the operation. |
void mate_vfs_inet_connection_destroy (MateVFSInetConnection *connection
,MateVFSCancellation *cancellation
);
Closes/Destroys connection
.
|
connection to destroy. |
|
handle for cancelling the operation. |
void mate_vfs_inet_connection_free (MateVFSInetConnection *connection
,MateVFSCancellation *cancellation
);
Frees connection
without closing the socket.
|
connection to free. |
|
handle for cancelling the operation. |
MateVFSSocket * mate_vfs_inet_connection_to_socket (MateVFSInetConnection *connection
);
Wrap connection
inside a standard MateVFSSocket for convenience.
|
connection to be wrapped into a MateVFSSocket. |
Returns : |
a newly created MateVFSSocket around connection .
|
MateVFSSocketBuffer * mate_vfs_inet_connection_to_socket_buffer
(MateVFSInetConnection *connection
);
Wrap connection
inside a standard MateVFSSocketBuffer for convenience.
|
connection to be wrapped into a MateVFSSocketBuffer. |
Returns : |
a newly created MateVFSSocketBuffer around connection .
|
int mate_vfs_inet_connection_get_fd (MateVFSInetConnection *connection
);
Retrieve the UNIX file descriptor corresponding to connection
.
|
connection to get the file descriptor from. |
Returns : |
file descriptor. |
MateVFSResult mate_vfs_inet_connection_create_from_address (MateVFSInetConnection **connection_return
,MateVFSAddress *address
,guint host_port
,MateVFSCancellation *cancellation
);
Creates a connection at connection_return
to address
using
port port
.
|
pointer to a pointer to a MateVFSInetConnection, which will contain an allocated MateVFSInetConnection object on return. |
|
a valid MateVFSAddress. |
|
port number to connect to. |
|
handle allowing cancellation of the operation. |
Returns : |
MateVFSResult indicating the success of the operation. |
Since 2.8
MateVFSAddress * mate_vfs_inet_connection_get_address
(MateVFSInetConnection *connection
);
Retrieve the address of the other side of a connected connection
.
|
connection to get the address from. |
Returns : |
a MateVFSAddress containing the address. Since 2.8 |
char * mate_vfs_inet_connection_get_ip (MateVFSInetConnection *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