SpiceClientGLib.Channel¶
- Subclasses:
SpiceClientGLib.CursorChannel,SpiceClientGLib.DisplayChannel,SpiceClientGLib.InputsChannel,SpiceClientGLib.MainChannel,SpiceClientGLib.PlaybackChannel,SpiceClientGLib.PortChannel,SpiceClientGLib.RecordChannel,SpiceClientGLib.SmartcardChannel,SpiceClientGLib.UsbredirChannel
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
Channel ID |
||
r/w/co |
Channel type |
||
r |
Underlying |
||
r/w/co |
Spice session |
||
r |
Total read bytes |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
The |
|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class SpiceClientGLib.Channel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
SpiceClientGLib.Channelstruct is opaque and should not be accessed directly.- classmethod new(s, type, id)¶
- Parameters:
s (
SpiceClientGLib.Session) – the SpiceSession the channel is linked totype (
int) – the requested SPICECHANNELPRIVATE typeid (
int) – the channel-id
- Returns:
a weak reference to
SpiceClientGLib.Channel, the session owns the reference- Return type:
Create a new
SpiceClientGLib.Channelof type type, and channel ID id.
- classmethod string_to_type(str)¶
- Parameters:
str (
str) – a string representation of the channel-type property- Returns:
the channel-type property value for a str channel
- Return type:
Convert a channel-type property value to a string.
New in version 0.21.
- classmethod type_to_string(type)¶
- Parameters:
type (
int) – a channel-type property value- Returns:
string representation of type.
- Return type:
Convert a channel-type property value to a string.
New in version 0.20.
- connect()¶
-
Connect the channel, using
SpiceClientGLib.Sessionconnection informations
- destroy()¶
Disconnect and unref the self.
Deprecated since version 0.27: this function has been deprecated because it is misleading, the object is not actually destroyed. Instead, it is recommended to call explicitely
SpiceClientGLib.Channel.disconnect() andGObject.Object.unref().
- disconnect(reason)¶
- Parameters:
reason (
SpiceClientGLib.ChannelEvent) – a channel event emitted on main context (orSpiceClientGLib.ChannelEvent.NONE)
Close the socket and reset connection specific data. Finally, emit reason
SpiceClientGLib.Channel::channel-eventon main context if notSpiceClientGLib.ChannelEvent.NONE.
- flush_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignorecallback (
Gio.AsyncReadyCallbackorNone) – callback to call when the request is satisfieduser_data (
objectorNone) – the data to pass to callback function
Forces an asynchronous write of all user-space buffered data for the given channel.
When the operation is finished callback will be called. You can then call
SpiceClientGLib.Channel.flush_finish() to get the result of the operation.New in version 0.15.
- flush_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
- Return type:
Finishes flushing a channel.
New in version 0.15.
- get_error()¶
- Returns:
the pointer to the error, or
None- Return type:
Retrieves the
GLib.Errorcurrently set on channel, if theSpiceClientGLib.Channelis in error state and can provide additional error details.New in version 0.24.
- open_fd(fd)¶
- Parameters:
fd (
int) – a file descriptor (socket) or -1. request mechanism- Returns:
Trueon success.- Return type:
Connect the channel using fd socket.
If fd is -1, a valid fd will be requested later via the
SpiceClientGLib.Channel::open-fdsignal.
- set_capability(cap)¶
- Parameters:
cap (
int) – a capability
Enable specific channel-kind capability.
Deprecated since version 0.13: this function has been removed
- test_capability(cap)¶
- Parameters:
cap (
int) – a capability- Returns:
Trueif cap (channel kind capability) is available.- Return type:
Test availability of remote “channel kind capability”.
- test_common_capability(cap)¶
- Parameters:
cap (
int) – a capability- Returns:
Trueif cap (common channel capability) is available.- Return type:
Test availability of remote “common channel capability”.
- do_channel_event(event) virtual¶
- Parameters:
event (
SpiceClientGLib.ChannelEvent) –
Signal class handler for the #SpiceChannel::channel_event signal.
- do_channel_send_migration_handshake() virtual¶
- do_channel_up() virtual¶
- do_handle_msg(msg) virtual¶
- Parameters:
msg (
SpiceClientGLib.MsgIn) –
- do_iterate_read() virtual¶
- do_iterate_write() virtual¶
Signal Details¶
- SpiceClientGLib.Channel.signals.channel_event(channel, event)¶
- Signal Name:
channel-event- Flags:
- Parameters:
channel (
SpiceClientGLib.Channel) – The object which received the signalevent (
SpiceClientGLib.ChannelEvent) – aSpiceClientGLib.ChannelEvent
The
SpiceClientGLib.Channel::channel-eventsignal is emitted when the state of the connection is changed. In case of errors,SpiceClientGLib.Channel.get_error() may provide additional informations on the source of the error.
- SpiceClientGLib.Channel.signals.open_fd(channel, with_tls)¶
- Signal Name:
open-fd- Flags:
- Parameters:
channel (
SpiceClientGLib.Channel) – The object which received the signalwith_tls (
int) – wether TLS connection is requested
The
SpiceClientGLib.Channel::open-fdsignal is emitted when a new connection is requested. This signal is emitted when the connection is made withSpiceClientGLib.Session.open_fd().
Property Details¶
- SpiceClientGLib.Channel.props.channel_id¶
- Name:
channel-id- Type:
- Default Value:
-1- Flags:
Channel ID
- SpiceClientGLib.Channel.props.channel_type¶
- Name:
channel-type- Type:
- Default Value:
-1- Flags:
Channel type
- SpiceClientGLib.Channel.props.socket¶
- Name:
socket- Type:
- Default Value:
- Flags:
Get the underlying
Gio.Socket. Note that you should not read or write any data to it directly since this will likely corrupt the channel stream. This property is mainly useful to get some connections details.New in version 0.33.
- SpiceClientGLib.Channel.props.spice_session¶
- Name:
spice-session- Type:
- Default Value:
- Flags:
Spice session