From a6d807b95a1edcc05318721fe7c8c7956182d9bd Mon Sep 17 00:00:00 2001 From: Alessio Igor Bogani <alessio.bogani@elettra.eu> Date: Thu, 18 Apr 2024 10:35:47 +0200 Subject: [PATCH] Write() always throws exception if buffer != 0 --- src/Socket2.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Socket2.cpp b/src/Socket2.cpp index 60c1f9b..698247b 100644 --- a/src/Socket2.cpp +++ b/src/Socket2.cpp @@ -505,7 +505,6 @@ void Socket2::write(const Tango::DevVarCharArray *argin) vector<unsigned char> argin_data; argin_data << *argin; size_t bytes_total = 0, bytes_to_write = argin_data.size(); - int olength; while (bytes_total < bytes_to_write) { int s = select(WRITE); @@ -533,12 +532,10 @@ void Socket2::write(const Tango::DevVarCharArray *argin) timeval twait; timerclear(&twait); twait.tv_usec = 1000; - olength = max(output_queue_length(), 0); - while ((bytes_total - olength) != bytes_to_write) { + while (max(output_queue_length(), 0) != 0) { if (! sleep(twait)) goto timeout; timeradd(&twait, &twait, &twait); - olength = max(output_queue_length(), 0); } return; -- GitLab