![]() |
![]() |
![]() |
Spice-GTK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <channel-port.h> struct SpicePortChannel; struct SpicePortChannelClass; void spice_port_event (SpicePortChannel *port
,guint8 event
); void spice_port_write_async (SpicePortChannel *port
,const void *buffer
,gsize count
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gssize spice_port_write_finish (SpicePortChannel *port
,GAsyncResult *result
,GError **error
);
A Spice port channel carry arbitrary data between the Spice client and the Spice server. It may be used to provide additional services on top of a Spice connection. For example, a channel can be associated with the qemu monitor for the client to interact with it, just like any qemu chardev. Or it may be used with various protocols, such as the Spice Controller.
A port kind is identified simply by a fqdn, such as org.qemu.monitor, org.spice.spicy.test or org.ovirt.controller...
Once connected and initialized, the client may read the name of the port via SpicePortChannel:port-name.
When the other end of the port is ready,
SpicePortChannel:port-opened is set to TRUE
and you can start
receiving data via the signal SpicePortChannel::port-data, or
sending data via spice_port_write_async()
.
struct SpicePortChannel;
The SpicePortChannel struct is opaque and should not be accessed directly.
struct SpicePortChannelClass { SpiceChannelClass parent_class; };
Class structure for SpicePortChannel.
SpiceChannelClass |
Parent class. |
void spice_port_event (SpicePortChannel *port
,guint8 event
);
Send an event to the port.
Note: The values SPICE_PORT_EVENT_CLOSED and SPICE_PORT_EVENT_OPENED are managed by the channel connection state.
|
a SpicePortChannel |
|
a SPICE_PORT_EVENT value |
Since 0.15
void spice_port_write_async (SpicePortChannel *port
,const void *buffer
,gsize count
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request an asynchronous write of count bytes from buffer
into the
port
. When the operation is finished callback
will be called. You
can then call spice_port_write_finish()
to get the result of
the operation.
|
A SpicePortChannel |
|
the buffer containing the data to write. [array length=count][element-type guint8] |
|
the number of bytes to write |
|
optional GCancellable object, NULL to ignore. [allow-none] |
|
callback to call when the request is satisfied. [scope async] |
|
the data to pass to callback function. [closure] |
Since 0.15
gssize spice_port_write_finish (SpicePortChannel *port
,GAsyncResult *result
,GError **error
);
Finishes a port write operation.
|
a SpicePortChannel |
|
a GAsyncResult |
|
a GError location to store the error occurring, or NULL
to ignore |
Returns : |
a gssize containing the number of bytes written to the stream. |
Since 0.15
"port-data"
signalvoid user_function (SpicePortChannel *spiceportchannel,
gpointer arg1,
gint arg2,
gpointer user_data) : Run Last
"port-event"
signalvoid user_function (SpicePortChannel *spiceportchannel,
gint arg1,
gpointer user_data) : Run Last