Infinity.SimulatedConnection¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37), Infinity.XmlConnection (6) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new() | 
| class | new_with_io(io) | 
| connect(to) | |
| flush() | |
| set_mode(mode) | 
Virtual Methods¶
| Inherited: | GObject.Object (7), Infinity.XmlConnection (6) | 
|---|
Properties¶
| Inherited: | Infinity.XmlConnection (6) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| io | Infinity.Io | r/w/co | The main loop to be used for IO_CONTROLLED mode | 
| mode | Infinity.SimulatedConnectionMode | r/w/c | The mode of the simulated connection | 
| target | Infinity.SimulatedConnection | r/w | The simulated connection receiving data sent through this connection | 
Signals¶
| Inherited: | GObject.Object (1), Infinity.XmlConnection (3) | 
|---|
Fields¶
| Inherited: | GObject.Object (1), Infinity.XmlConnection (3) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | GObject.Object | r | 
Class Details¶
- 
class Infinity.SimulatedConnection(**kwargs)¶
- Bases: - GObject.Object,- Infinity.XmlConnection- Abstract: - No - Structure: - Infinity.SimulatedConnectionClass- 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: - Infinity.SimulatedConnection- Creates a new - Infinity.SimulatedConnection. A connection created this way cannot be switched to- Infinity.SimulatedConnectionMode.IO_CONTROLLEDmode. Use- Infinity.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 for- Infinity.SimulatedConnectionMode.IO_CONTROLLEDmode.- Returns: - A new - Infinity.SimulatedConnection.- Return type: - Infinity.SimulatedConnection- Creates a new - Infinity.SimulatedConnectionwith the given- Infinity.Io. This connection can be used with- Infinity.SimulatedConnectionMode.IO_CONTROLLEDmode. If you don’t intend to use that mode then using- Infinity.SimulatedConnection.new() is also good enough since the- Infinity.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.DELAYEDor- Infinity.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 to- Infinity.XmlConnection.send().- In - Infinity.SimulatedConnectionMode.DELAYEDmode, messages sent are queued and received by the target when- Infinity.SimulatedConnection.flush() is called.- In - Infinity.SimulatedConnectionMode.IO_CONTROLLEDmode, messages are queued and received by the target as soon as a dispatch handler (see- Infinity.Io.add_dispatch()) installed on the main loop is called.- When changing the mode from - Infinity.SimulatedConnectionMode.DELAYEDor- Infinity.SimulatedConnectionMode.IO_CONTROLLEDto- Infinity.SimulatedConnectionMode.IMMEDIATE, then the queue is flushed, too.
 
- 
classmethod 
Property Details¶
- 
Infinity.SimulatedConnection.props.io¶
- Name: - io- Type: - Infinity.Io- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The main loop to be used for IO_CONTROLLED mode 
- 
Infinity.SimulatedConnection.props.mode¶
- Name: - mode- Type: - Infinity.SimulatedConnectionMode- Default Value: - Infinity.SimulatedConnectionMode.IMMEDIATE- Flags: - READABLE,- WRITABLE,- CONSTRUCT- The mode of the simulated connection 
- 
Infinity.SimulatedConnection.props.target¶
- Name: - target- Type: - Infinity.SimulatedConnection- Default Value: - None- Flags: - READABLE,- WRITABLE- The simulated connection receiving data sent through this connection