Infinity.SimulatedConnection¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
The main loop to be used for IO_CONTROLLED mode |
||
r/w/c |
The mode of the simulated connection |
||
r/w |
The simulated connection receiving data sent through this connection |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Infinity.SimulatedConnection(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Infinity.SimulatedConnectionis an opaque data type. You should only access it via the public API functions.- classmethod new()¶
- Returns:
A new
Infinity.SimulatedConnection.- Return type:
Creates a new
Infinity.SimulatedConnection. A connection created this way cannot be switched toInfinity.SimulatedConnectionMode.IO_CONTROLLEDmode. UseInfinity.SimulatedConnection.new_with_io() instead if you intend to do that.
- classmethod new_with_io(io)¶
- Parameters:
io (
Infinity.Io) – The main loop to be used forInfinity.SimulatedConnectionMode.IO_CONTROLLEDmode.- Returns:
A new
Infinity.SimulatedConnection.- Return type:
Creates a new
Infinity.SimulatedConnectionwith the givenInfinity.Io. This connection can be used withInfinity.SimulatedConnectionMode.IO_CONTROLLEDmode. If you don’t intend to use that mode then usingInfinity.SimulatedConnection.new() is also good enough since theInfinity.Ioobject is not required in that case.
- connect(to)¶
- Parameters:
to (
Infinity.SimulatedConnection) – The target connection.
Connects two simulated connections, so that data sent through one of them is received by the other one and vice versa. So one call to this function connects both
Infinity.SimulatedConnections to each other. There is no need to call this function once for each connection.If one or both of the connections already have another target, then the simulated connection between those is closed first.
- flush()¶
When self's mode is
Infinity.SimulatedConnectionMode.DELAYEDorInfinity.SimulatedConnectionMode.IO_CONTROLLED, then calling this function makes the target connection receive all the queued messages.
- set_mode(mode)¶
- Parameters:
mode (
Infinity.SimulatedConnectionMode) – The new mode to set.
Sets the mode of the simulated connection.
In
Infinity.SimulatedConnectionMode.IMMEDIATEmode, messages sent through the connection are received by the target during the call toInfinity.XmlConnection.send().In
Infinity.SimulatedConnectionMode.DELAYEDmode, messages sent are queued and received by the target whenInfinity.SimulatedConnection.flush() is called.In
Infinity.SimulatedConnectionMode.IO_CONTROLLEDmode, messages are queued and received by the target as soon as a dispatch handler (seeInfinity.Io.add_dispatch()) installed on the main loop is called.When changing the mode from
Infinity.SimulatedConnectionMode.DELAYEDorInfinity.SimulatedConnectionMode.IO_CONTROLLEDtoInfinity.SimulatedConnectionMode.IMMEDIATE, then the queue is flushed, too.
Property Details¶
- Infinity.SimulatedConnection.props.io¶
- Name:
io- Type:
- Default Value:
- Flags:
The main loop to be used for IO_CONTROLLED mode
- Infinity.SimulatedConnection.props.mode¶
- Name:
mode- Type:
- Default Value:
- Flags:
The mode of the simulated connection
- Infinity.SimulatedConnection.props.target¶
- Name:
target- Type:
- Default Value:
- Flags:
The simulated connection receiving data sent through this connection