UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2002-07-25 06:44 PM

HectorLasso
Administrator
From: Colombia
Registered: 2002-06-12
Posts: 353

Re: 3.5 - How to set the timeout for the connect() system call

sts = connect(mysock, &msaddr, sizeof (msaddr)); 
    if (sts) 
    { 
if (errno == ECONNREFUSED) 
{ 
printf("connection refused\n"); 
return; 
} 
else if (errno == ETIMEDOUT) 
{ 
printf("connection attempt timed out\n"); 
return; 
}

Offline

Board footer

Powered by FluxBB