Subversion Repositories HomeAutomation

Rev

Rev 974 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 974 Rev 975
Line 258... Line 258...
258
    }
258
    }
259
}
259
}
260
 
260
 
261
void AsyncSocket::connect()
261
void AsyncSocket::connect()
262
{
262
{
263
    if (mySocket != -1)
-
 
264
    {
-
 
265
        ::close(mySocket);
263
    close();
266
        mySocket = -1;
-
 
267
    }
-
 
268
   
264
   
269
    mySocket = ::socket(AF_INET, SOCK_STREAM, 0);
265
    mySocket = ::socket(AF_INET, SOCK_STREAM, 0);
270
 
266
 
271
    int on = 1;
267
    int on = 1;
272
    int status = setsockopt(mySocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));
268
    int status = setsockopt(mySocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));