Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
1r0b1n0 committed Nov 17, 2017
1 parent c69483e commit d6ac011
Show file tree
Hide file tree
Showing 8 changed files with 487 additions and 407 deletions.
6 changes: 6 additions & 0 deletions src/ros_lib/RosQtSocket.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "ros/RosQtSocket.h"

//#define ROSQT_VERBOSE

using std::string;
using std::cerr;
using std::endl;
Expand Down Expand Up @@ -40,7 +42,9 @@ int64_t RosQtSocket::read(unsigned char *data, int max_length)
{
if(socket_.state() != QAbstractSocket::ConnectedState)
{
#ifdef ROSQT_VERBOSE
std::cerr << "Failed to receive data from server, not connected " << std::endl;
#endif
doConnect();
return -1;
}
Expand All @@ -59,7 +63,9 @@ bool RosQtSocket::write(const unsigned char *data, int length)
{
if(socket_valid_ && socket_.state() != QAbstractSocket::ConnectedState)
{
#ifdef ROSQT_VERBOSE
std::cerr << "Failed to write data to the server, not connected " << std::endl;
#endif
doConnect();
return false;
}
Expand Down
Loading

0 comments on commit d6ac011

Please sign in to comment.