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.Channel
struct 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.Channel
of 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.Session
connection 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-event
on main context if notSpiceClientGLib.ChannelEvent.NONE
.
- flush_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignorecallback (
Gio.AsyncReadyCallback
orNone
) – callback to call when the request is satisfieduser_data (
object
orNone
) – 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.Error
currently set on channel, if theSpiceClientGLib.Channel
is 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:
True
on 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-fd
signal.
- 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:
True
if 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:
True
if cap (common channel capability) is available.- Return type:
Test availability of remote “common channel capability”.
- do_channel_event(event) virtual¶
- Parameters:
event (
SpiceClientGLib.ChannelEvent
) –
- 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-event
signal 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-fd
signal 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