soup-context

Name

soup-context -- 

Synopsis



struct      SoupContext;
struct      SoupConnection;
enum        SoupConnectErrorCode;
void        (*SoupConnectCallbackFn)        (SoupContext *ctx,
                                             SoupConnectErrorCode err,
                                             SoupConnection *conn,
                                             gpointer user_data);
typedef     SoupConnectId;
SoupContext* soup_context_get               (const gchar *uri);
SoupContext* soup_context_from_uri          (SoupUri *suri);
void        soup_context_ref                (SoupContext *ctx);
void        soup_context_unref              (SoupContext *ctx);
SoupConnectId soup_context_get_connection   (SoupContext *ctx,
                                             SoupConnectCallbackFn cb,
                                             gpointer user_data);
const SoupUri* soup_context_get_uri         (SoupContext *ctx);
void        soup_context_cancel_connect     (SoupConnectId tag);
GIOChannel* soup_connection_get_iochannel   (SoupConnection *conn);
SoupContext* soup_connection_get_context    (SoupConnection *conn);
void        soup_connection_set_keep_alive  (SoupConnection *conn,
                                             gboolean keepalive);
gboolean    soup_connection_is_keep_alive   (SoupConnection *conn);
gboolean    soup_connection_is_new          (SoupConnection *conn);
void        soup_connection_release         (SoupConnection *conn);

Description

Details

struct SoupContext

struct SoupContext;


struct SoupConnection

struct SoupConnection;


enum SoupConnectErrorCode

typedef enum {
	SOUP_CONNECT_ERROR_NONE,
	SOUP_CONNECT_ERROR_ADDR_RESOLVE,
	SOUP_CONNECT_ERROR_NETWORK
} SoupConnectErrorCode;


SoupConnectCallbackFn ()

void        (*SoupConnectCallbackFn)        (SoupContext *ctx,
                                             SoupConnectErrorCode err,
                                             SoupConnection *conn,
                                             gpointer user_data);


SoupConnectId

typedef gpointer SoupConnectId;


soup_context_get ()

SoupContext* soup_context_get               (const gchar *uri);

Returns a pointer to the SoupContext representing uri. If a context already exists for the URI, it is returned with an added reference. Otherwise, a new context is created with a reference count of one.


soup_context_from_uri ()

SoupContext* soup_context_from_uri          (SoupUri *suri);

Returns a pointer to the SoupContext representing suri. If a context already exists for the URI, it is returned with an added reference. Otherwise, a new context is created with a reference count of one.


soup_context_ref ()

void        soup_context_ref                (SoupContext *ctx);

Adds a reference to ctx.


soup_context_unref ()

void        soup_context_unref              (SoupContext *ctx);

Decrement the reference count on ctx. If the reference count reaches zero, the SoupContext is freed. If this is the last context for a given server address, any open connections are closed.


soup_context_get_connection ()

SoupConnectId soup_context_get_connection   (SoupContext *ctx,
                                             SoupConnectCallbackFn cb,
                                             gpointer user_data);

Initiates the process of establishing a network connection to the server referenced in ctx. If an existing connection is available and not in use, cb is called immediately, and a SoupConnectId of 0 is returned. Otherwise, a new connection is established. If the current connection count exceeds that set in soup_set_connection_limit, the new connection is not created until an existing connection is closed.

Once a network connection is successfully established, or an existing connection becomes available for use, cb is called, passing the SoupConnection representing it.


soup_context_get_uri ()

const SoupUri* soup_context_get_uri         (SoupContext *ctx);

Returns a pointer to the SoupUri represented by ctx.


soup_context_cancel_connect ()

void        soup_context_cancel_connect     (SoupConnectId tag);

Cancels the connection attempt represented by tag. The SoupConnectCallbackFn passed in soup_context_get_connection is not called.


soup_connection_get_iochannel ()

GIOChannel* soup_connection_get_iochannel   (SoupConnection *conn);

Returns a GIOChannel used for IO operations on the network connection represented by conn.


soup_connection_get_context ()

SoupContext* soup_connection_get_context    (SoupConnection *conn);

Returns the SoupContext from which conn was created.


soup_connection_set_keep_alive ()

void        soup_connection_set_keep_alive  (SoupConnection *conn,
                                             gboolean keepalive);


soup_connection_is_keep_alive ()

gboolean    soup_connection_is_keep_alive   (SoupConnection *conn);


soup_connection_is_new ()

gboolean    soup_connection_is_new          (SoupConnection *conn);

Returns TRUE if this is the first use of conn (I.E. soup_connection_release has not yet been called on it).


soup_connection_release ()

void        soup_connection_release         (SoupConnection *conn);

Mark the connection represented by conn as being unused. If the keep-alive flag is not set on the connection, the connection is closed and its resources freed, otherwise the connection is returned to the unused connection pool for the server.