17 #include "connectiontcpclient.h"
20 #include "mutexguard.h"
27 #if ( !defined( _WIN32 ) && !defined( _WIN32_WCE ) ) || defined( __SYMBIAN32__ )
28 # include <sys/types.h>
29 # include <sys/socket.h>
30 # include <sys/select.h>
34 #elif ( defined( _WIN32 ) || defined( _WIN32_WCE ) ) && !defined( __SYMBIAN32__ )
45 const std::string& server,
int port )
51 const std::string& server,
int port )
100 m_server +
": connection refused" );
108 "Unknown error condition" );
128 if( m_cancel || m_socket < 0 )
134 if( !dataAvailable( timeout ) )
140 int size =
static_cast<int>(
::recv( m_socket, m_buf, m_bufsize, 0 ) );
142 m_totalBytesIn += size;
151 std::string message =
"recv() failed. "
152 #if defined( _WIN32 ) && !defined( __SYMBIAN32__ )
153 "WSAGetLastError: " + util::int2string( ::WSAGetLastError() );
155 "errno: " + util::int2string( errno ) +
": " + strerror( errno );