NonBlocking Sockets retries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tawanda diza
    New Member
    • Sep 2011
    • 29

    NonBlocking Sockets retries

    Hie Team.
    I am using Visual C++ 2008, i have set a non blocking socket using
    Code:
    unsigned long iMode=1;
    ioctlsocket(hServer,FIONBIO,&iMode);
    nData = recv( hServer, &wzRec[iPos], 1500, 0 );
    could some one help on how to set a timeout of say like 10 seconds for this receive to time out if no data has been received within that time frame.

    as it is, my application exits even when the server takes a half second to reply which i dont want, i want the application to wait for ten seconds for the response after which it may then time out,


    thanks in advance
Working...