Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: ResumeThread not calling function Pin
Stephen Hewitt25-Sep-07 14:49
Stephen Hewitt25-Sep-07 14:49 
GeneralRe: ResumeThread not calling function Pin
rp_suman25-Sep-07 15:05
rp_suman25-Sep-07 15:05 
Questionif problems Pin
dellthinker25-Sep-07 12:19
dellthinker25-Sep-07 12:19 
AnswerRe: if problems Pin
Mark Salsbery25-Sep-07 13:09
Mark Salsbery25-Sep-07 13:09 
GeneralRe: if problems Pin
dellthinker25-Sep-07 14:02
dellthinker25-Sep-07 14:02 
GeneralRe: if problems Pin
Mark Salsbery25-Sep-07 14:17
Mark Salsbery25-Sep-07 14:17 
GeneralRe: if problems Pin
dellthinker25-Sep-07 14:20
dellthinker25-Sep-07 14:20 
GeneralRe: if problems Pin
Mark Salsbery25-Sep-07 14:38
Mark Salsbery25-Sep-07 14:38 
The key point I was trying to make is that you need to check for success/fail on
all connect() calls.

You can code it any way you want.  The simplest, least elegant way is nested "if"s

if (SOCKET_ERROR == connect(..))
{
   ... try next address
   if (SOCKET_ERROR == connect(..))
   {
      ... try next address
      if (SOCKET_ERROR == connect(..))
      {
         ... try next address
         if (SOCKET_ERROR == connect(..))
         {
            // all four connect() attempts failed!
         }
      }
   }
}

You can get as fancy as you want. 

For example, a more elegant solution would be a configurable
list of addresses/server names that you loop through until
you get a successful connection.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionRe: if problems Pin
David Crow26-Sep-07 3:38
David Crow26-Sep-07 3:38 
AnswerRe: if problems Pin
dellthinker26-Sep-07 14:24
dellthinker26-Sep-07 14:24 
QuestionRe: if problems Pin
David Crow26-Sep-07 16:27
David Crow26-Sep-07 16:27 
AnswerRe: if problems Pin
dellthinker30-Sep-07 15:53
dellthinker30-Sep-07 15:53 
QuestionCan't write files with large filenames onto CD/DVD Pin
vijay_aroli25-Sep-07 9:39
vijay_aroli25-Sep-07 9:39 
AnswerRe: Can't write files with large filenames onto CD/DVD Pin
Jeremy Falcon25-Sep-07 10:44
professionalJeremy Falcon25-Sep-07 10:44 
GeneralRe: Can't write files with large filenames onto CD/DVD Pin
vijay_aroli25-Sep-07 10:53
vijay_aroli25-Sep-07 10:53 
QuestionDLL export library ( .lib file) Pin
act_x25-Sep-07 5:35
act_x25-Sep-07 5:35 
AnswerRe: DLL export library ( .lib file) Pin
Jeremy Falcon25-Sep-07 5:44
professionalJeremy Falcon25-Sep-07 5:44 
AnswerRe: DLL export library ( .lib file) Pin
DevMentor.org25-Sep-07 6:57
DevMentor.org25-Sep-07 6:57 
AnswerRe: DLL export library ( .lib file) Pin
VonHagNDaz25-Sep-07 10:56
VonHagNDaz25-Sep-07 10:56 
QuestionDumping values.. Pin
Eytukan25-Sep-07 5:11
Eytukan25-Sep-07 5:11 
AnswerRe: Dumping values.. Pin
Jeremy Falcon25-Sep-07 5:42
professionalJeremy Falcon25-Sep-07 5:42 
GeneralRe: Dumping values.. Pin
Mark Salsbery25-Sep-07 5:44
Mark Salsbery25-Sep-07 5:44 
GeneralRe: Dumping values.. Pin
Jeremy Falcon25-Sep-07 5:45
professionalJeremy Falcon25-Sep-07 5:45 
GeneralRe: Dumping values.. Pin
Eytukan25-Sep-07 6:18
Eytukan25-Sep-07 6:18 
GeneralRe: Dumping values.. Pin
Eytukan25-Sep-07 6:09
Eytukan25-Sep-07 6:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.