X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=iotjava%2Fiotrmi%2FC%2B%2B%2FIoTSocketClient.hpp;h=b69555fbaff39841076d2abf2295c1ce622e5281;hb=38523cbbcc710ff7413e8b5d85df402aa109bd13;hp=dd5d377086309c62c9df77b1cb48200fc8a78608;hpb=3c4fd177d5f1eec65478dee1d16f7eb0ad31bcf6;p=iot2.git diff --git a/iotjava/iotrmi/C++/IoTSocketClient.hpp b/iotjava/iotrmi/C++/IoTSocketClient.hpp index dd5d377..b69555f 100644 --- a/iotjava/iotrmi/C++/IoTSocketClient.hpp +++ b/iotjava/iotrmi/C++/IoTSocketClient.hpp @@ -49,11 +49,8 @@ IoTSocketClient::IoTSocketClient(int iPort, const char* pStrHost, bool bReverse, m_addrRemote.sin_addr = *((struct in_addr *) he->h_addr); memset(&(m_addrRemote.sin_zero), 0, 8); - if (connect(m_iSock, (struct sockaddr *) &m_addrRemote, sizeof(struct sockaddr)) == -1) { - - perror("IoTSocketClient: Connect m_iSock error!"); - return; - } + // Make socket client wait for socket server to be ready + while (connect(m_iSock, (struct sockaddr *) &m_addrRemote, sizeof(struct sockaddr)) == -1) { } // Send out request for reversed bits or not char temp[1];