![]() |
![]() |
![]() |
libinfinity-0.3 Reference Manual | ![]() |
---|---|---|---|---|
#include <libinfinity/common/inf-simulated-connection.h> InfSimulatedConnection; InfSimulatedConnectionClass; enum InfSimulatedConnectionMode; InfSimulatedConnection* inf_simulated_connection_new (void); void inf_simulated_connection_connect (InfSimulatedConnection *connection, InfSimulatedConnection *to); void inf_simulated_connection_set_mode (InfSimulatedConnection *connection, InfSimulatedConnectionMode mode); void inf_simulated_connection_flush (InfSimulatedConnection *connection);
"mode" InfSimulatedConnectionMode : Read / Write / Construct "target" InfSimulatedConnection* : Read / Write
InfSimulatedConnection simulates a connection and can be used everywhere
where a InfXmlConnection is expected. Use
inf_simulated_connection_connect()
to connect two such connections so that
data sent through one is received by the other.
typedef struct _InfSimulatedConnection InfSimulatedConnection;
InfSimulatedConnection is an opaque data type. You should only access it via the public API functions.
typedef struct { } InfSimulatedConnectionClass;
This structure does not contain any public fields.
typedef enum _InfSimulatedConnectionMode { INF_SIMULATED_CONNECTION_IMMEDIATE, INF_SIMULATED_CONNECTION_DELAYED } InfSimulatedConnectionMode;
The mode of a simulated connection defines when sent messages arrive at the target connection.
Messages are received directly by the
target site when calling inf_xml_connection_send() .
|
|
Messages are queued, and delivered to
the target site when inf_simulated_connection_flush() is called.
|
InfSimulatedConnection* inf_simulated_connection_new (void);
Creates a new InfSimulatedConnection.
Returns : |
A new InfSimulatedConnection. |
void inf_simulated_connection_connect (InfSimulatedConnection *connection, InfSimulatedConnection *to);
Connects two simulated connections, so that data sent through one of them is received by the other one. If one or both of the connections already have another target, then the simulated connection between those is closed first.
|
A InfSimulatedConnection. |
|
The target connection. |
void inf_simulated_connection_set_mode (InfSimulatedConnection *connection, InfSimulatedConnectionMode mode);
Sets the mode of the simulated connection.
In INF_SIMULATED_CONNECTION_IMMEDIATE
mode, messages sent through the
connection are received by the target during the call to
inf_xml_connection_send()
.
In INF_SIMULATED_CONNECTION_DELAYED
mode, messages sent are queued and
received by the target when inf_simulated_connection_flush()
is called.
When changing the mode from INF_SIMULATED_CONNECTION_DELAYED
to
INF_SIMULATED_CONNECTION_IMMEDIATE
, then the queue is flushed, too.
|
A InfSimulatedConnection. |
|
The new mode to set. |
void inf_simulated_connection_flush (InfSimulatedConnection *connection);
When connection
's mode is INF_SIMULATED_CONNECTION_DELAYED
, then calling
this function makes the target connection receive all the queued messages.
|
A InfSimulatedConnection. |
"mode"
property"mode" InfSimulatedConnectionMode : Read / Write / Construct
The mode of the simulated connection.
Default value: INF_SIMULATED_CONNECTION_IMMEDIATE
"target"
property"target" InfSimulatedConnection* : Read / Write
The simulated connection receiving data sent through this connection.