1.23 <SoupSession>

Class: <SoupSession>

It derives from <GObject>.

Soup session state object.

Session is the object that controls client-side HTTP. A Session encapsulates all of the state that libsoup is keeping on behalf of your program; cached HTTP connections, authentication information, etc. It also keeps track of various global options and features that you are using.

Most applications will only need a single Session; the primary reason you might need multiple sessions is if you need to have multiple independent authentication contexts. (Eg, you are connecting to a server and authenticating as two different users at different times; the easiest way to ensure that each Message is sent with the authentication information you intended is to use one session for the first user, and a second session for the other user.)

Additional Session functionality is provided by SessionFeature objects, which can be added to a session with Session.add_feature or Session.add_feature_by_type For example, Logger provides support for logging HTTP traffic, ContentDecoder provides support for compressed response handling, and ContentSniffer provides support for HTML5-style response body content sniffing. Additionally, subtypes of Auth can be added as features, to add support for additional authentication types.

All <SoupSession>s are created with a AuthManager, and support for SOUP_TYPE_AUTH_BASIC and SOUP_TYPE_AUTH_DIGEST. Additionally, sessions using the plain Session class (rather than one of its deprecated subtypes) have a ContentDecoder by default.

Note that all async methods will invoke their callbacks on the thread-default context at the time of the function call.

Fields

parent-instance

Properties

Property: session:accept-language self

If non-#f, the value to use for the "Accept-Language" header on Messages sent from this session.

Setting this will disable Session:accept-language-auto.

Its value is a string, or #f.

Set it with (set! (session:accept-language self) value).

Property: session:accept-language-auto self

If #t, Session will automatically set the string for the "Accept-Language" header on every Message sent, based on the return value of get-language-names.

Setting this will override any previous value of Session:accept-language.

Its value is a boolean.

Set it with (set! (session:accept-language-auto self) value).

Property: session:idle-timeout self

Connection lifetime (in seconds) when idle. Any connection left idle longer than this will be closed.

Although you can change this property at any time, it will only affect newly-created connections, not currently-open ones. You can call Session.abort after setting this if you want to ensure that all future connections will have this timeout value.

Its value is an unsigned 32-bit integer.

Set it with (set! (session:idle-timeout self) value).

Property: session:local-address self

Sets the <GInetSocketAddress> to use for the client side of the connection.

Use this property if you want for instance to bind the local socket to a specific IP address.

Its value is a <GInetSocketAddress>, or #f.

It can only be set when the object is made, with #:local-address.

Property: session:max-conns self

The maximum number of connections that the session can open at once.

Its value is a 32-bit integer.

It can only be set when the object is made, with #:max-conns.

Property: session:max-conns-per-host self

The maximum number of connections that the session can open at once to a given host.

Its value is a 32-bit integer.

It can only be set when the object is made, with #:max-conns-per-host.

Property: session:proxy-resolver self

A <GProxyResolver> to use with this session.

If no proxy resolver is set, then the default proxy resolver will be used. See proxy-resolver:get-default. You can set it to #f if you don’t want to use proxies, or set it to your own <GProxyResolver> if you want to control what proxies get used.

Its value is a <GProxyResolver>, or #f.

Set it with (set! (session:proxy-resolver self) value).

Property: session:remote-connectable self

Sets a socket to make outgoing connections on. This will override the default behaviour of opening TCP/IP sockets to the hosts specified in the URIs.

This function is not required for common HTTP usage, but only when connecting to a HTTP service that is not using standard TCP/IP sockets. An example of this is a local service that uses HTTP over UNIX-domain sockets, in that case a <GUnixSocketAddress> can be passed to this function.

Its value is a <GSocketConnectable>, or #f.

It can only be set when the object is made, with #:remote-connectable.

Property: session:timeout self

The timeout (in seconds) for socket I/O operations (including connecting to a server, and waiting for a reply to an HTTP request).

Although you can change this property at any time, it will only affect newly-created connections, not currently-open ones. You can call Session.abort after setting this if you want to ensure that all future connections will have this timeout value.

Not to be confused with Session:idle-timeout (which is the length of time that idle persistent connections will be kept open).

Its value is an unsigned 32-bit integer.

Set it with (set! (session:timeout self) value).

Property: session:tls-database self

Sets the <GTlsDatabase> to use for validating SSL/TLS certificates.

If no certificate database is set, then the default database will be used. See tls-backend:get-default-database.

Its value is a <GTlsDatabase>, or #f.

Set it with (set! (session:tls-database self) value).

Property: session:tls-interaction self

A <GTlsInteraction> object that will be passed on to any <GTlsConnection>s created by the session.

This can be used to provide client-side certificates, for example.

Its value is a <GTlsInteraction>, or #f.

Set it with (set! (session:tls-interaction self) value).

Property: session:user-agent self

User-Agent string.

If non-#f, the value to use for the "User-Agent" header on Messages sent from this session.

RFC 2616 says: "The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests."

The User-Agent header contains a list of one or more product tokens, separated by whitespace, with the most significant product token coming first. The tokens must be brief, ASCII, and mostly alphanumeric (although "-", "_", and "." are also allowed), and may optionally include a "/" followed by a version string. You may also put comments, enclosed in parentheses, between or after the tokens.

If you set a Session:user-agent property that has trailing whitespace, Session will append its own product token (eg, libsoup/2.3.2) to the end of the header for you.

Its value is a string, or #f.

Set it with (set! (session:user-agent self) value).

Procedures

Method: session:abort self
Method: abort self

Cancels all pending requests in self and closes all idle persistent connections.

self

Passed: a <SoupSession>.

the session

Method: session:add-feature self feature
Method: add-feature self feature

Adds feature’s functionality to self. You cannot add multiple features of the same GObject.Type to a session.

See the main Session documentation for information on what features are present in sessions by default.

self

Passed: a <SoupSession>.

a <SoupSession>

feature

Passed: a <SoupSessionFeature>.

an object that implements <SoupSessionFeature>

Method: session:add-feature-by-type self feature-type
Method: add-feature-by-type self feature-type

If feature-type is the type of a class that implements SessionFeature, this creates a new feature of that type and adds it to self as with Session.add_feature. You can use this when you don’t need to customize the new feature in any way. Adding multiple features of the same feature-type is not allowed.

If feature-type is not a SessionFeature type, this gives each existing feature on self the chance to accept feature-type as a "subfeature". This can be used to add new Auth types, for instance.

See the main Session documentation for information on what features are present in sessions by default.

self

Passed: a <SoupSession>.

a <SoupSession>

feature-type

Passed: a class, or a GType number.

a GType

Method: session:get-accept-language self ⇒ %return
Method: get-accept-language self ⇒ %return

Get the value used by self for the "Accept-Language" header on new requests.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a string, or #f.

the accept language string

Method: session:get-accept-language-auto? self ⇒ %return
Method: get-accept-language-auto? self ⇒ %return

Gets whether self automatically sets the "Accept-Language" header on new requests.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a boolean.

#t if self sets "Accept-Language" header automatically, or #f otherwise.

Method: session:get-async-result-message self result ⇒ %return
Method: get-async-result-message self result ⇒ %return

Gets the Message of the result asynchronous operation This is useful to get the Message of an asynchronous operation started by self from its GAsyncReadyCallback.

self

Passed: a <SoupSession>.

a <SoupSession>

result

Passed: a <GAsyncResult>.

the <GAsyncResult> passed to your callback

%return

Returned: a <SoupMessage>, or #f.

a <SoupMessage> or #f if result is not a valid self async operation result.

Method: session:get-feature self feature-type ⇒ %return
Method: get-feature self feature-type ⇒ %return

Gets the feature in self of type feature-type.

self

Passed: a <SoupSession>.

a <SoupSession>

feature-type

Passed: a class, or a GType number.

the GType of the feature to get

%return

Returned: a <SoupSessionFeature>, or #f.

a <SoupSessionFeature>, or #f. The feature is owned by self.

Method: session:get-feature-for-message self feature-type msg ⇒ %return
Method: get-feature-for-message self feature-type msg ⇒ %return

Gets the feature in self of type feature-type, provided that it is not disabled for msg.

self

Passed: a <SoupSession>.

a <SoupSession>

feature-type

Passed: a class, or a GType number.

the GType of the feature to get

msg

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <SoupSessionFeature>, or #f.

a <SoupSessionFeature>. The feature is owned by self.

Method: session:get-idle-timeout self ⇒ %return
Method: get-idle-timeout self ⇒ %return

Get the timeout in seconds for idle connection lifetime currently used by self.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: an unsigned 32-bit integer.

the timeout in seconds

Method: session:get-local-address self ⇒ %return
Method: get-local-address self ⇒ %return

Get the <GInetSocketAddress> to use for the client side of connections in self.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a <GInetSocketAddress>, or #f.

a <GInetSocketAddress>

Method: session:get-max-conns self ⇒ %return
Method: get-max-conns self ⇒ %return

Get the maximum number of connections that self can open at once.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: an unsigned 32-bit integer.

the maximum number of connections

Method: session:get-max-conns-per-host self ⇒ %return
Method: get-max-conns-per-host self ⇒ %return

Get the maximum number of connections that self can open at once to a given host.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: an unsigned 32-bit integer.

the maximum number of connections per host

Method: session:get-proxy-resolver self ⇒ %return
Method: get-proxy-resolver self ⇒ %return

Get the <GProxyResolver> currently used by self.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a <GProxyResolver>, or #f.

a <GProxyResolver> or #f if proxies are disabled in self

Method: session:get-remote-connectable self ⇒ %return
Method: get-remote-connectable self ⇒ %return

Gets the remote connectable if one set.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a <GSocketConnectable>, or #f.

the <GSocketConnectable>

Method: session:get-timeout self ⇒ %return
Method: get-timeout self ⇒ %return

Get the timeout in seconds for socket I/O operations currently used by self.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: an unsigned 32-bit integer.

the timeout in seconds

Method: session:get-tls-database self ⇒ %return
Method: get-tls-database self ⇒ %return

Get the <GTlsDatabase> currently used by self.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a <GTlsDatabase>, or #f.

a <GTlsDatabase>

Method: session:get-tls-interaction self ⇒ %return
Method: get-tls-interaction self ⇒ %return

Get the <GTlsInteraction> currently used by self.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a <GTlsInteraction>, or #f.

a <GTlsInteraction>

Method: session:get-user-agent self ⇒ %return
Method: get-user-agent self ⇒ %return

Get the value used by self for the "User-Agent" header on new requests.

self

Passed: a <SoupSession>.

a <SoupSession>

%return

Returned: a string, or #f.

the user agent string

Method: session:has-feature? self feature-type ⇒ %return
Method: has-feature? self feature-type ⇒ %return

Tests if self has at a feature of type feature-type (which can be the type of either a SessionFeature, or else a subtype of some class managed by another feature, such as Auth).

self

Passed: a <SoupSession>.

a <SoupSession>

feature-type

Passed: a class, or a GType number.

the GType of the class of features to check for

%return

Returned: a boolean.

#t or #f

Procedure: session:new ⇒ %return

Creates a Session with the default options.

%return

Returned: a <SoupSession>.

the new session.

Method: session:preconnect-async self msg io-priority [cancellable] [callback]
Method: preconnect-async self msg io-priority [cancellable] [callback]

Start a preconnection to msg.

Once the connection is done, it will remain in idle state so that it can be reused by future requests. If there’s already an idle connection for the given msg host, the operation finishes successfully without creating a new connection. If a new request for the given msg host is made while the preconnect is still ongoing, the request will take the ownership of the connection and the preconnect operation will finish successfully (if there’s a connection error it will be handled by the request).

The operation finishes when the connection is done or an error occurred.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

a <SoupMessage>

io-priority

Passed: a 32-bit integer.

the I/O priority of the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

the callback to invoke when the operation finishes

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data for progress-callback and callback

Method: session:preconnect-finish? self result ⇒ %return
Method: preconnect-finish? self result ⇒ %return

Complete a preconnect async operation started with Session.preconnect_async.

self

Passed: a <SoupSession>.

a <SoupSession>

result

Passed: a <GAsyncResult>.

the <GAsyncResult> passed to your callback

%return

Returned: a boolean.

#t if the preconnect succeeded, or #f in case of error.

Method: session:remove-feature self feature
Method: remove-feature self feature

Removes feature’s functionality from self.

self

Passed: a <SoupSession>.

a <SoupSession>

feature

Passed: a <SoupSessionFeature>.

a feature that has previously been added to self

Method: session:remove-feature-by-type self feature-type
Method: remove-feature-by-type self feature-type

Removes all features of type feature-type (or any subclass of feature-type) from self.

self

Passed: a <SoupSession>.

a <SoupSession>

feature-type

Passed: a class, or a GType number.

a GType

Method: session:send self msg [cancellable] ⇒ %return
Method: send self msg [cancellable] ⇒ %return

Synchronously sends msg and waits for the beginning of a response.

On success, a <GInputStream> will be returned which you can use to read the response body. ("Success" here means only that an HTTP response was received and understood; it does not necessarily mean that a 2xx class status code was received.)

If non-#f, cancellable can be used to cancel the request; Session.send will return a cancelled error. Note that with requests that have side effects (eg, POST, PUT, DELETE) it is possible that you might cancel the request after the server acts on it, but before it returns a response, leaving the remote resource in an unknown state.

If msg is requeued due to a redirect or authentication, the initial (3xx/401/407) response body will be suppressed, and Session.send will only return once a final response has been received.

Possible error domains include SessionError, <GIOErrorEnum>, and <GTlsError> which you may want to specifically handle.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

a <SoupMessage>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

%return

Returned: a <GInputStream>.

a <GInputStream> for reading the response body, or #f on error.

Method: session:send-and-read self msg [cancellable] ⇒ %return
Method: send-and-read self msg [cancellable] ⇒ %return

Synchronously sends msg and reads the response body.

On success, a <GBytes> will be returned with the response body. This function should only be used when the resource to be retrieved is not too long and can be stored in memory.

See Session.send for more details on the general semantics.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

a <SoupMessage>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

%return

Returned: a <GBytes>.

a <GBytes>, or #f on error.

Method: session:send-and-read-async self msg io-priority [cancellable] [callback]
Method: send-and-read-async self msg io-priority [cancellable] [callback]

Asynchronously sends msg and reads the response body.

When callback is called, then either msg has been sent, and its response body read, or else an error has occurred. This function should only be used when the resource to be retrieved is not too long and can be stored in memory. Call Session.send_and_read_finish to get a <GBytes> with the response body.

See Session.send for more details on the general semantics.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

a <SoupMessage>

io-priority

Passed: a 32-bit integer.

the I/O priority of the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

the callback to invoke

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data for callback

Method: session:send-and-read-finish self result ⇒ %return
Method: send-and-read-finish self result ⇒ %return

Gets the response to a Session.send_and_read_async.

If successful, returns a <GBytes> with the response body.

self

Passed: a <SoupSession>.

a <SoupSession>

result

Passed: a <GAsyncResult>.

the <GAsyncResult> passed to your callback

%return

Returned: a <GBytes>.

a <GBytes>, or #f on error.

Method: session:send-and-splice self msg out-stream flags [cancellable] ⇒ %return
Method: send-and-splice self msg out-stream flags [cancellable] ⇒ %return

Synchronously sends msg and splices the response body stream into out-stream.

See Session.send for more details on the general semantics.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

a <SoupMessage>

out-stream

Passed: a <GOutputStream>.

a <GOutputStream>

flags

Passed: a <GOutputStreamSpliceFlags>, or a list of its symbols, or one of them.

a set of <GOutputStreamSpliceFlags>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

%return

Returned: a 64-bit integer.

a gssize containing the size of the data spliced, or -1 if an error occurred.

Method: session:send-and-splice-async self msg out-stream flags io-priority [cancellable] [callback]
Method: send-and-splice-async self msg out-stream flags io-priority [cancellable] [callback]

Asynchronously sends msg and splices the response body stream into out-stream. When callback is called, then either msg has been sent and its response body spliced, or else an error has occurred.

See Session.send for more details on the general semantics.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

a <SoupMessage>

out-stream

Passed: a <GOutputStream>.

a <GOutputStream>

flags

Passed: a <GOutputStreamSpliceFlags>, or a list of its symbols, or one of them.

a set of <GOutputStreamSpliceFlags>

io-priority

Passed: a 32-bit integer.

the I/O priority of the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

the callback to invoke

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data for callback

Method: session:send-and-splice-finish self result ⇒ %return
Method: send-and-splice-finish self result ⇒ %return

Gets the response to a Session.send_and_splice_async.

self

Passed: a <SoupSession>.

a <SoupSession>

result

Passed: a <GAsyncResult>.

the <GAsyncResult> passed to your callback

%return

Returned: a 64-bit integer.

a gssize containing the size of the data spliced, or -1 if an error occurred.

Method: session:send-async self msg io-priority [cancellable] [callback]
Method: send-async self msg io-priority [cancellable] [callback]

Asynchronously sends msg and waits for the beginning of a response.

When callback is called, then either msg has been sent, and its response headers received, or else an error has occurred. Call Session.send_finish to get a <GInputStream> for reading the response body.

See Session.send for more details on the general semantics.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

a <SoupMessage>

io-priority

Passed: a 32-bit integer.

the I/O priority of the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

the callback to invoke

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data for callback

Method: session:send-finish self result ⇒ %return
Method: send-finish self result ⇒ %return

Gets the response to a Session.send_async call.

If successful returns a <GInputStream> that can be used to read the response body.

self

Passed: a <SoupSession>.

a <SoupSession>

result

Passed: a <GAsyncResult>.

the <GAsyncResult> passed to your callback

%return

Returned: a <GInputStream>.

a <GInputStream> for reading the response body, or #f on error.

Method: session:set-accept-language self accept-language
Method: set-accept-language self accept-language

Set the value to use for the "Accept-Language" header on Messages sent from self.

If accept-language is #f then no "Accept-Language" will be included in requests. See Session:accept-language for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

accept-language

Passed: a string.

the languages string

Method: session:set-accept-language-auto self accept-language-auto
Method: set-accept-language-auto self accept-language-auto

Set whether self will automatically set the "Accept-Language" header on requests using a value generated from system languages based on get-language-names.

See Session:accept-language-auto for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

accept-language-auto

Passed: a boolean.

the value to set

Method: session:set-idle-timeout self timeout
Method: set-idle-timeout self timeout

Set a timeout in seconds for idle connection lifetime to be used by self on new connections.

See Session:idle-timeout for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

timeout

Passed: an unsigned 32-bit integer.

a timeout in seconds

Method: session:set-proxy-resolver self [proxy-resolver]
Method: set-proxy-resolver self [proxy-resolver]

Set a <GProxyResolver> to be used by self on new connections.

If proxy-resolver is #f then no proxies will be used. See Session:proxy-resolver for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

proxy-resolver

Passed, or left out: a <GProxyResolver>, or #f.

a <GProxyResolver> or #f

Method: session:set-timeout self timeout
Method: set-timeout self timeout

Set a timeout in seconds for socket I/O operations to be used by self on new connections.

See Session:timeout for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

timeout

Passed: an unsigned 32-bit integer.

a timeout in seconds

Method: session:set-tls-database self [tls-database]
Method: set-tls-database self [tls-database]

Set a <GTlsDatabase> to be used by self on new connections.

If tls-database is #f then certificate validation will always fail. See Session:tls-database for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

tls-database

Passed, or left out: a <GTlsDatabase>, or #f.

a <GTlsDatabase>

Method: session:set-tls-interaction self [tls-interaction]
Method: set-tls-interaction self [tls-interaction]

Set a <GTlsInteraction> to be used by self on new connections.

If tls-interaction is #f then client certificate validation will always fail.

See Session:tls-interaction for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

tls-interaction

Passed, or left out: a <GTlsInteraction>, or #f.

a <GTlsInteraction>

Method: session:set-user-agent self user-agent
Method: set-user-agent self user-agent

Set the value to use for the "User-Agent" header on Messages sent from self.

If user-agent has trailing whitespace, self will append its own product token (eg, libsoup/3.0.0) to the end of the header for you. If user-agent is #f then no "User-Agent" will be included in requests. See Session:user-agent for more information.

self

Passed: a <SoupSession>.

a <SoupSession>

user-agent

Passed: a string.

the user agent string

Method: session:websocket-connect-async self msg origin protocols io-priority [cancellable] [callback]
Method: websocket-connect-async self msg origin protocols io-priority [cancellable] [callback]

Asynchronously creates a WebsocketConnection to communicate with a remote server.

All necessary WebSocket-related headers will be added to msg, and it will then be sent and asynchronously processed normally (including handling of redirection and HTTP authentication).

If the server returns "101 Switching Protocols", then msg’s status code and response headers will be updated, and then the WebSocket handshake will be completed. On success, Session.websocket_connect_finish will return a new WebsocketConnection. On failure it will return a <GError>.

If the server returns a status other than "101 Switching Protocols", then msg will contain the complete response headers and body from the server’s response, and Session.websocket_connect_finish will return not-websocket.

self

Passed: a <SoupSession>.

a <SoupSession>

msg

Passed: a <SoupMessage>.

<SoupMessage> indicating the WebSocket server to connect to

origin

Passed: a string, or #f.

origin of the connection

protocols

Passed: a list or vector, each a string, or #f.

a #f-terminated array of protocols supported

io-priority

Passed: a 32-bit integer.

the I/O priority of the request

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

the callback to invoke

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data for callback

Method: session:websocket-connect-finish self result ⇒ %return
Method: websocket-connect-finish self result ⇒ %return

Gets the WebsocketConnection response to a Session.websocket_connect_async call.

If successful, returns a WebsocketConnection that can be used to communicate with the server.

self

Passed: a <SoupSession>.

a <SoupSession>

result

Passed: a <GAsyncResult>.

the <GAsyncResult> passed to your callback

%return

Returned: a <SoupWebsocketConnection>.

a new <SoupWebsocketConnection>, or #f on error.

Signals

Signal: session:request-queued

Connect a handler with (connect object session:request-queued handler). It is called as (handler self msg).

Emitted when a request is queued on session.

When sending a request, first "request-queued" is emitted, indicating that the session has become aware of the request.

After a connection is available to send the request various Message signals are emitted as the message is processed. If the message is requeued, it will emit "restarted", which will then be followed by other Message signals when the message is re-sent.

Eventually, the message will emit "finished". Normally, this signals the completion of message processing. However, it is possible that the application will requeue the message from the "finished" handler. In that case the process will loop back.

Eventually, a message will reach "finished" and not be requeued. At that point, the session will emit "request-unqueued" to indicate that it is done with the message.

To sum up: "request-queued" and "request-unqueued" are guaranteed to be emitted exactly once, but "finished" (and all of the other Message signals) may be invoked multiple times for a given message.

self

Passed: a <SoupSession>.

msg

Passed: a <SoupMessage>.

the request that was queued

Signal: session:request-unqueued

Connect a handler with (connect object session:request-unqueued handler). It is called as (handler self msg).

Emitted when a request is removed from session’s queue, indicating that session is done with it.

See "request-queued" for a detailed description of the message lifecycle within a session.

self

Passed: a <SoupSession>.

msg

Passed: a <SoupMessage>.

the request that was unqueued

Virtual methods

Virtual method: session:do-request-queued implementor self msg

To override it in a new class, give register-type #:vfuncs `((request-queued . ,procedure)). The procedure is called as (procedure self msg).

implementor

Passed: the class whose implementation to call: <SoupSession>, or a class that derives from it, or its GType number.

self

Passed: a <SoupSession>.

msg

Passed: a <SoupMessage>.

Virtual method: session:do-request-unqueued implementor self msg

To override it in a new class, give register-type #:vfuncs `((request-unqueued . ,procedure)). The procedure is called as (procedure self msg).

implementor

Passed: the class whose implementation to call: <SoupSession>, or a class that derives from it, or its GType number.

self

Passed: a <SoupSession>.

msg

Passed: a <SoupMessage>.