SpiceClientGLib.Channel
Description: Reference for SpiceClientGLib.Channel

### Class

# SpiceClientGLibChannel

#### Description [src]

    class SpiceClientGLib.Channel : GObject.Object
    {
      SpiceChannelPrivate* priv
    }

The `SpiceChannel` struct is opaque and should not be accessed directly.

#### Ancestors

- GObject

#### Descendants

- SpiceCursorChannel
- SpiceDisplayChannel
- SpiceInputsChannel
- SpiceMainChannel
- SpicePlaybackChannel
- SpicePortChannel
- SpiceRecordChannel
- SpiceSmartcardChannel
- SpiceUsbredirChannel

#### Constructors

###### spice_channel_new

Create a new `SpiceChannel` of type `type`, and channel ID `id`.

#### Functions

###### spice_channel_string_to_type

Convert a channel-type property value to a string.

since: 0.21

###### spice_channel_type_to_string

Convert a channel-type property value to a string.

since: 0.7

#### Instance methods

###### spice_channel_connect

Connect the channel, using `SpiceSession` connection informations.

###### spice_channel_destroy

Disconnect and unref the `channel`.

deprecated: 0.27

###### spice_channel_disconnect

Close the socket and reset connection specific data. Finally, emit `reason` `SpiceChannel::channel-event` on main context if not

# SPICE_CHANNEL_NONE.

###### spice_channel_flush_async

Forces an asynchronous write of all user-space buffered data for the given channel.

since: 0.15

###### spice_channel_flush_finish

Finishes flushing a channel.

since: 0.15

###### spice_channel_get_error

Retrieves the `GError` currently set on channel, if the `SpiceChannel` is in error state and can provide additional error details.

since: 0.24

###### spice_channel_open_fd

Connect the channel using `fd` socket.

###### spice_channel_set_capability

Enable specific channel-kind capability.

deprecated: 0.13

###### spice_channel_test_capability

Test availability of remote “channel kind capability”.

###### spice_channel_test_common_capability

Test availability of remote “common channel capability”.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### SpiceClientGLib.Channel:channel-id

No description available.

###### SpiceClientGLib.Channel:channel-type

No description available.

###### SpiceClientGLib.Channel:socket

Get the underlying `GSocket`. 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.

since: 0.33

###### SpiceClientGLib.Channel:spice-session

No description available.

###### SpiceClientGLib.Channel:total-read-bytes

No description available.

#### Signals

###### SpiceClientGLib.Channel::channel-event

The `SpiceChannel::channel-event` signal is emitted when the state of the connection is changed. In case of errors, `spice_channel_get_error()` may provide additional informations on the source of the error.

###### SpiceClientGLib.Channel::open-fd

The `SpiceChannel::open-fd` signal is emitted when a new connection is requested. This signal is emitted when the connection is made with spice_session_open_fd().

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct SpiceClientGLibChannelClass {
      GObjectClass parent_class;
      void (* channel_event) (
        SpiceChannel* channel,
        SpiceChannelEvent event
      );
      void (* open_fd) (
        SpiceChannel* channel,
        int with_tls
      );
      void (* handle_msg) (
        SpiceChannel* channel,
        SpiceMsgIn* msg
      );
      void (* channel_up) (
        SpiceChannel* channel
      );
      void (* iterate_write) (
        SpiceChannel* channel
      );
      void (* iterate_read) (
        SpiceChannel* channel
      );
      void (* channel_reset) (
        SpiceChannel* channel,
        gboolean migrating
      );
      void (* channel_send_migration_handshake) (
        SpiceChannel* channel
      );

    }

Class structure for `SpiceChannel`.

###### Class members

`parent_class: GObjectClass`

  Parent class.

`channel_event: void (* channel_event) ( SpiceChannel* channel, SpiceChannelEvent event )`

  Signal class handler for the `SpiceChannel::channel_event` signal.

`open_fd: void (* open_fd) ( SpiceChannel* channel, int with_tls )`

  Signal class handler for the `SpiceChannel::open_fd` signal.

`handle_msg: void (* handle_msg) ( SpiceChannel* channel, SpiceMsgIn* msg )`

  No description available.

`channel_up: void (* channel_up) ( SpiceChannel* channel )`

  No description available.

`iterate_write: void (* iterate_write) ( SpiceChannel* channel )`

  No description available.

`iterate_read: void (* iterate_read) ( SpiceChannel* channel )`

  No description available.

`channel_reset: void (* channel_reset) ( SpiceChannel* channel, gboolean migrating )`

  No description available.

`channel_send_migration_handshake: void (* channel_send_migration_handshake) ( SpiceChannel* channel )`

  No description available.

#### Virtual methods

###### SpiceClientGLib.ChannelClass.channel_event

Signal class handler for the `SpiceChannel::channel_event` signal.

###### SpiceClientGLib.ChannelClass.channel_reset

No description available.

###### SpiceClientGLib.ChannelClass.channel_send_migration_handshake

No description available.

###### SpiceClientGLib.ChannelClass.channel_up

No description available.

###### SpiceClientGLib.ChannelClass.handle_msg

No description available.

###### SpiceClientGLib.ChannelClass.iterate_read

No description available.

###### SpiceClientGLib.ChannelClass.iterate_write

No description available.

###### SpiceClientGLib.ChannelClass.open_fd

Signal class handler for the `SpiceChannel::open_fd` signal.