- bool m_bReverse; // Am I reversing byte order or not?
- int m_iListen; // Descriptor we are listening on
- struct sockaddr_in m_addrMe; // My address information
+ bool m_bReverse; // Am I reversing byte order or not?
+ int m_iListen; // Descriptor we are listening on
+ struct sockaddr_in m_addrMe; // My address information
if ((m_iListen = socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
perror("IoTSocketServer: Socket error!");
if ((m_iListen = socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
perror("IoTSocketServer: Socket error!");
if ((m_iSock = accept(m_iListen, (struct sockaddr *) &m_addrRemote, &iSinSize)) == -1)
{
perror("IoTSocketServer: Accept connection error!");
return false;
}
if ((m_iSock = accept(m_iListen, (struct sockaddr *) &m_addrRemote, &iSinSize)) == -1)
{
perror("IoTSocketServer: Accept connection error!");
return false;
}
// The client sends us an int to indicate if we should
// be reversing byte order on this connection. The client
// is sending 0 or 1, so a reversed 0 still looks
// The client sends us an int to indicate if we should
// be reversing byte order on this connection. The client
// is sending 0 or 1, so a reversed 0 still looks
iResult = recv(m_iSock, temp, 1, 0);
iTotal += iResult;
}
iResult = recv(m_iSock, temp, 1, 0);
iTotal += iResult;
}