### Class

# GVnc Connection

#### Description

    class GVnc.Connection : GObject.Object
    {
      priv: VncConnectionPrivate*
    }

No description available.

#### Ancestors

- GObject

#### Constructors

###### vnc_connection_new

Create a new connection object, which is initially in the disconnected state.

#### Instance methods

###### vnc_connection_audio_disable

Tell the server that it is no longer permitted to send audio. The client may continue to receive audio for a time after this, since packets may already be in flight.

###### vnc_connection_audio_enable

Tell the server that it is permitted to send audio data.

###### vnc_connection_client_cut_text

No description available.

###### vnc_connection_framebuffer_update_request

Request that the server send a framebuffer update when the region positioned at (`x`, `y`) wth size (`width`, `height`) sees damage. The update sent may be a subset of the region requested, if `incremental` is FALSE.

###### vnc_connection_get_abs_pointer

Determine if the remote server supports absolute pointer motion events. This will only be valid once the “vnc-initialized” signal has been emitted.

###### vnc_connection_get_audio_format

Get the current audio format specification.

###### vnc_connection_get_cursor

Get the cursor currently associated with the desktop, if any.

###### vnc_connection_get_ext_key_event

Determine if the remote server supports the extended keyboard event which transmits raw XT scancodes. This will only be valid once the “vnc-initialized” signal has been emitted.

###### vnc_connection_get_height

Get the height of the remote display. The height will only be set once the “vnc-initialized” signal has been emitted.

###### vnc_connection_get_ledstate

Get the current LED state bitmap. This is only valid once the “vnc-initialized” signal has been emitted.

###### vnc_connection_get_name

Get the name of the remote display. A name will only be available once the “vnc-initialized” signal has been emitted.

###### vnc_connection_get_pixel_format

Get a specification of the current pixel format.

###### vnc_connection_get_power_control

Determine if the remote server supports power control. This will only be valid once the “vnc-initialized” signal has been emitted.

###### vnc_connection_get_shared

Get the sharing state for the connection.

###### vnc_connection_get_width

Get the width of the remote display. The width will only be set once the “vnc-initialized” signal has been emitted.

###### vnc_connection_has_error

Determine if the current connection is in an error state.

###### vnc_connection_is_initialized

Determine if the connection to the remote desktop is fully initialized and thus receiving framebuffer updates.

###### vnc_connection_is_open

Check if the connection is currently open.

###### vnc_connection_key_event

Send a key press/release event to the server. By default the event will be sent with the X11 key code from `key`. If the extended key event protocol extension is active, the `scancode` will be sent instead.

###### vnc_connection_open_addr

Open a socket connection to server identified by `addr`. `addr` may refer to either a TCP address (IPv4/6) or a UNIX socket address. The `hostname` provided should reflect the name of the host that the `addr` provides a connection to, if it is not already available in `addr`. For example, if `addr` points to a proxy server, then `hostname` can be used to provide the name of the final endpoint. This will be used by some authentication schemes, for example x509 certificate validation against `hostname`.

###### vnc_connection_open_fd

Open a connection using `fd` as the transport. If `fd` refers to a TCP connection, it is recommended to use vnc_connection_open_fd_with_hostname instead, to provide the remote hostname. This allows use of x509 based authentication which requires a hostname to be available.

###### vnc_connection_open_fd_with_hostname

Open a connection using `fd` as the transport. The `hostname` provided should reflect the name of the host that the `fd` provides a connection to. This will be used by some authentication schemes, for example x509 certificate validation against `hostname`.

###### vnc_connection_open_host

Open a TCP connection to the remote desktop at `host` listening on `port`.

###### vnc_connection_pointer_event

Send a pointer event to the server, reflecting either movement of the pointer, or a change in state of its buttons, or both.

###### vnc_connection_power_control

Perform a power control action on the remote server.

###### vnc_connection_set_audio

Set the audio sink to use for playing back audio from the remote session.

###### vnc_connection_set_audio_format

Set the audio format specification to use for playback from the remote session. The format should only be set when the audio stream is not active, otherwise it will be impossible to determine when the server has switched to sending data in the new format.

###### vnc_connection_set_auth_subtype

If a multi-level authentication scheme was requested, this identifies which auth type to use for the second phase.

###### vnc_connection_set_auth_type

Set the authentication type to use to complete the connection.

###### vnc_connection_set_credential

Sets the value of the authentication credential `type` to the string `data`.

###### vnc_connection_set_encodings

Inform the server of the list of encodings that it is allowed to send. This should be done before requesting any framebuffer updates.

###### vnc_connection_set_framebuffer

Set the framebuffer object to which frame buffer updates will be written.

###### vnc_connection_set_pixel_format

Tell the server what pixel format to use for framebuffer updates. It is only safe to use this when no framebuffer updates are pending, otherwise it is impossible to determine when the server has switched over to using the new format.

###### vnc_connection_set_shared

Set the shared state for the connection. A TRUE value allow allow this client to co-exist with other existing clients. A FALSE value will cause other clients to be dropped.

###### vnc_connection_set_size

No description available.

###### vnc_connection_shutdown

Initiate a shutdown of the current connection by closing its socket.

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

Please see GObject for a full list of methods.

#### Properties

###### GVnc.Connection:framebuffer

No description available.

#### Signals

###### GVnc.Connection::vnc-auth-choose-subtype

No description available.

###### GVnc.Connection::vnc-auth-choose-type

No description available.

###### GVnc.Connection::vnc-auth-credential

No description available.

###### GVnc.Connection::vnc-auth-failure

No description available.

###### GVnc.Connection::vnc-auth-unsupported

No description available.

###### GVnc.Connection::vnc-bell

No description available.

###### GVnc.Connection::vnc-connected

No description available.

###### GVnc.Connection::vnc-cursor-changed

Emitted when the cursor is changed.

###### GVnc.Connection::vnc-desktop-rename

No description available.

###### GVnc.Connection::vnc-desktop-resize

No description available.

###### GVnc.Connection::vnc-disconnected

No description available.

###### GVnc.Connection::vnc-error

No description available.

###### GVnc.Connection::vnc-framebuffer-update

No description available.

###### GVnc.Connection::vnc-initialized

No description available.

###### GVnc.Connection::vnc-led-state

No description available.

###### GVnc.Connection::vnc-pixel-format-changed

No description available.

###### GVnc.Connection::vnc-pointer-mode-changed

No description available.

###### GVnc.Connection::vnc-power-control-failed

No description available.

###### GVnc.Connection::vnc-power-control-initialized

No description available.

###### GVnc.Connection::vnc-server-cut-text

No description available.

##### 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 GVncConnectionClass {
      GObjectClass parent_class;
      void (* vnc_cursor_changed) (
        VncConnection* conn,
        VncCursor* cursor
      );
      void (* vnc_pointer_mode_changed) (
        VncConnection* conn,
        gboolean absPointer
      );
      void (* vnc_bell) (
        VncConnection* conn
      );
      void (* vnc_server_cut_text) (
        VncConnection* conn,
        const GString* text
      );
      void (* vnc_framebuffer_update) (
        VncConnection* conn,
        guint16 x,
        guint16 y,
        guint16 width,
        guint16 height
      );
      void (* vnc_desktop_resize) (
        VncConnection* conn,
        guint16 width,
        guint16 height
      );
      void (* vnc_pixel_format_changed) (
        VncConnection* conn,
        VncPixelFormat* format
      );
      void (* vnc_auth_failure) (
        VncConnection* conn,
        const char* reason
      );
      void (* vnc_auth_unsupported) (
        VncConnection* conn,
        unsigned int authType
      );
      void (* vnc_auth_credential) (
        VncConnection* conn,
        GValueArray* creds
      );
      void (* vnc_auth_choose_type) (
        VncConnection* conn,
        GValueArray* types
      );
      void (* vnc_auth_choose_subtype) (
        VncConnection* conn,
        unsigned int type,
        GValueArray* subtypes
      );
      void (* vnc_connected) (
        VncConnection* conn
      );
      void (* vnc_initialized) (
        VncConnection* conn
      );
      void (* vnc_disconnected) (
        VncConnection* conn
      );
      void (* vnc_led_state) (
        VncConnection* conn
      );
      void (* vnc_error) (
        VncConnection* conn,
        const char* message
      );
      void (* vnc_power_control_initialized) (
        VncConnection* conn
      );
      void (* vnc_power_control_failed) (
        VncConnection* conn
      );
      void (* vnc_desktop_rename) (
        VncConnection* conn,
        const char* name
      );
      None _vnc_reserved;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`vnc_cursor_changed: void (* vnc_cursor_changed) ( VncConnection* conn, VncCursor* cursor )`

  No description available.

`vnc_pointer_mode_changed: void (* vnc_pointer_mode_changed) ( VncConnection* conn, gboolean absPointer )`

  No description available.

`vnc_bell: void (* vnc_bell) ( VncConnection* conn )`

  No description available.

`vnc_server_cut_text: void (* vnc_server_cut_text) ( VncConnection* conn, const GString* text )`

  No description available.

`vnc_framebuffer_update: void (* vnc_framebuffer_update) ( VncConnection* conn, guint16 x, guint16 y, guint16 width, guint16 height )`

  No description available.

`vnc_desktop_resize: void (* vnc_desktop_resize) ( VncConnection* conn, guint16 width, guint16 height )`

  No description available.

`vnc_pixel_format_changed: void (* vnc_pixel_format_changed) ( VncConnection* conn, VncPixelFormat* format )`

  No description available.

`vnc_auth_failure: void (* vnc_auth_failure) ( VncConnection* conn, const char* reason )`

  No description available.

`vnc_auth_unsupported: void (* vnc_auth_unsupported) ( VncConnection* conn, unsigned int authType )`

  No description available.

`vnc_auth_credential: void (* vnc_auth_credential) ( VncConnection* conn, GValueArray* creds )`

  No description available.

`vnc_auth_choose_type: void (* vnc_auth_choose_type) ( VncConnection* conn, GValueArray* types )`

  No description available.

`vnc_auth_choose_subtype: void (* vnc_auth_choose_subtype) ( VncConnection* conn, unsigned int type, GValueArray* subtypes )`

  No description available.

`vnc_connected: void (* vnc_connected) ( VncConnection* conn )`

  No description available.

`vnc_initialized: void (* vnc_initialized) ( VncConnection* conn )`

  No description available.

`vnc_disconnected: void (* vnc_disconnected) ( VncConnection* conn )`

  No description available.

`vnc_led_state: void (* vnc_led_state) ( VncConnection* conn )`

  No description available.

`vnc_error: void (* vnc_error) ( VncConnection* conn, const char* message )`

  No description available.

`vnc_power_control_initialized: void (* vnc_power_control_initialized) ( VncConnection* conn )`

  No description available.

`vnc_power_control_failed: void (* vnc_power_control_failed) ( VncConnection* conn )`

  No description available.

`vnc_desktop_rename: void (* vnc_desktop_rename) ( VncConnection* conn, const char* name )`

  No description available.

`_vnc_reserved: None`

  No description available.

#### Virtual methods

###### GVnc.ConnectionClass.vnc_auth_choose_subtype

No description available.

###### GVnc.ConnectionClass.vnc_auth_choose_type

No description available.

###### GVnc.ConnectionClass.vnc_auth_credential

No description available.

###### GVnc.ConnectionClass.vnc_auth_failure

No description available.

###### GVnc.ConnectionClass.vnc_auth_unsupported

No description available.

###### GVnc.ConnectionClass.vnc_bell

No description available.

###### GVnc.ConnectionClass.vnc_connected

No description available.

###### GVnc.ConnectionClass.vnc_cursor_changed

No description available.

###### GVnc.ConnectionClass.vnc_desktop_rename

No description available.

###### GVnc.ConnectionClass.vnc_desktop_resize

No description available.

###### GVnc.ConnectionClass.vnc_disconnected

No description available.

###### GVnc.ConnectionClass.vnc_error

No description available.

###### GVnc.ConnectionClass.vnc_framebuffer_update

No description available.

###### GVnc.ConnectionClass.vnc_initialized

No description available.

###### GVnc.ConnectionClass.vnc_led_state

No description available.

###### GVnc.ConnectionClass.vnc_pixel_format_changed

No description available.

###### GVnc.ConnectionClass.vnc_pointer_mode_changed

No description available.

###### GVnc.ConnectionClass.vnc_power_control_failed

No description available.

###### GVnc.ConnectionClass.vnc_power_control_initialized

No description available.

###### GVnc.ConnectionClass.vnc_server_cut_text

No description available.