diff --git a/libguac/include/protocol.h b/libguac/include/protocol.h index fc73394d..a525ddab 100644 --- a/libguac/include/protocol.h +++ b/libguac/include/protocol.h @@ -180,6 +180,17 @@ typedef enum guac_line_join_style { */ int guac_protocol_send_args(guac_socket* socket, const char** args); +/** + * Sends a begin instruction over the given guac_socket connection. + * + * If an error occurs sending the instruction, a non-zero value is + * returned, and guac_error is set appropriately. + * + * @param socket The guac_socket connection to use. + * @return Zero on success, non-zero on error. + */ +int guac_protocol_send_begin(guac_socket* socket); + /** * Sends a connect instruction over the given guac_socket connection. * diff --git a/libguac/src/protocol.c b/libguac/src/protocol.c index eba527d7..bda4b920 100644 --- a/libguac/src/protocol.c +++ b/libguac/src/protocol.c @@ -399,6 +399,9 @@ int guac_protocol_send_arc(guac_socket* socket, const guac_layer* layer, } +int guac_protocol_send_begin(guac_socket* socket) { + return guac_socket_write_string(socket, "5.begin;"); +} int guac_protocol_send_cfill(guac_socket* socket, guac_composite_mode mode, const guac_layer* layer,