Skip to content
Snippets Groups Projects
Commit 45ebc2eb authored by Alessio Igor Bogani's avatar Alessio Igor Bogani
Browse files

Add a sleep if write() fails immediately

parent 18270fec
No related branches found
Tags 1.2.0
No related merge requests found
......@@ -532,14 +532,19 @@ void Socket2::write(const Tango::DevVarCharArray *argin)
{
delete argin_data;
string error_mesg = "Connection refused";
close();
open();
string error_mesg = "Connection refused";
DEBUG_STREAM << error_mesg << endl;
set_state( Tango::FAULT );
set_status( error_mesg );
sleep( tout.tv_sec );
usleep( tout.tv_usec );
timerclear( &tout );
Tango::Except::throw_exception( "",
error_mesg,
"Socket2::write()");
......@@ -586,11 +591,12 @@ void Socket2::write(const Tango::DevVarCharArray *argin)
if( (bytes_total - output_queue_length()) != bytes_to_write )
{
string error_mesg = "Unable to send request to device";
close();
open();
string error_mesg = "Unable to send request to device";
DEBUG_STREAM << error_mesg << endl;
set_state( Tango::FAULT );
set_status( error_mesg );
......@@ -997,9 +1003,11 @@ bool Socket2::read(timeval *tv)
close();
open();
DEBUG_STREAM << "Server shutting down" << endl;
string error_mesg = "Server shutting down";
DEBUG_STREAM << error_mesg << endl;
set_state(Tango::FAULT);
set_status("Server shutting down");
set_status(error_mesg);
sleep( tv->tv_sec );
usleep( tv->tv_usec );
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment