From 5e141f1fbc1f5917d19f14d3b0ba6f485c0b6dad Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 29 Aug 2024 22:25:11 +0200 Subject: [PATCH] clone in c example --- crates/servicepoint_binding_c/examples/lang_c/src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/servicepoint_binding_c/examples/lang_c/src/main.c b/crates/servicepoint_binding_c/examples/lang_c/src/main.c index 10477a8..451abe7 100644 --- a/crates/servicepoint_binding_c/examples/lang_c/src/main.c +++ b/crates/servicepoint_binding_c/examples/lang_c/src/main.c @@ -2,7 +2,7 @@ #include "servicepoint.h" int main(void) { - sp_Connection *connection = sp_connection_open("localhost:2342"); + sp_Connection *connection = sp_connection_open("172.23.42.29:2342"); if (connection == NULL) return 1; @@ -11,9 +11,9 @@ int main(void) { sp_CCommand *command = sp_command_bitmap_linear_win(0, 0, pixels, Uncompressed); sp_Packet *packet = sp_packet_from_command(command); - if (!sp_connection_send(connection, packet)) - return 1; + while (sp_connection_send(connection, sp_packet_clone(packet))); + sp_packet_dealloc(packet); sp_connection_dealloc(connection); return 0; }