diff --git a/include/blc_array_network.h b/include/blc_array_network.h index 4bada8900cc41df0fc6183632b40d1afbcb57464..9a15d8cca659d27bf47aad828024fef4363d60b0 100644 --- a/include/blc_array_network.h +++ b/include/blc_array_network.h @@ -15,8 +15,8 @@ typedef struct blc_array_network :blc_array{ ~blc_array_network(); - int recv_data(); - int send_data(); + virtual int recv_data()=0; + virtual int send_data()=0; #else blc_array array; #endif diff --git a/include/blc_array_tcp4_client.h b/include/blc_array_tcp4_client.h index 15592d55c431b746fcd9d10038f090e0b8d100ee..d8b343f3ba40177de1c6d3a634c65de5c7887762 100644 --- a/include/blc_array_tcp4_client.h +++ b/include/blc_array_tcp4_client.h @@ -18,7 +18,7 @@ typedef struct blc_array_tcp4_client // void server_manager(); int recv_data(); int bytes_to_read(); - void send_data(); + int send_data(); #else { blc_array array;// Not beautiful but makes it easy to convert C++ heritage of "class" in C struct inclusion. #endif diff --git a/src/network/blc_array_tcp4_client.cpp b/src/network/blc_array_tcp4_client.cpp index c801ad2f048ea6f30a42afa739cdd7beb2bd2d61..f305c8ce09e145cad5cd3473d662427f2e8bb4a6 100644 --- a/src/network/blc_array_tcp4_client.cpp +++ b/src/network/blc_array_tcp4_client.cpp @@ -64,8 +64,9 @@ int blc_array_tcp4_client::bytes_to_read(){ return bytes_nb; } -void blc_array_tcp4_client::send_data(){ +int blc_array_tcp4_client::send_data(){ SYSTEM_ERROR_CHECK(write(socket_fd, data, size), -1, nullptr); + return 0; // no error }