Click here to Skip to main content
15,887,347 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionmfc application hangs Pin
Abinash Mohanty18-Mar-10 22:34
Abinash Mohanty18-Mar-10 22:34 
AnswerRe: mfc application hangs Pin
Mohan Ramachandra18-Mar-10 22:47
Mohan Ramachandra18-Mar-10 22:47 
GeneralRe: mfc application hangs Pin
Abinash Mohanty18-Mar-10 23:09
Abinash Mohanty18-Mar-10 23:09 
GeneralRe: mfc application hangs Pin
KarstenK19-Mar-10 0:00
mveKarstenK19-Mar-10 0:00 
GeneralRe: mfc application hangs Pin
Abinash Mohanty18-Mar-10 23:30
Abinash Mohanty18-Mar-10 23:30 
AnswerRe: mfc application hangs Pin
Rajesh R Subramanian18-Mar-10 22:55
professionalRajesh R Subramanian18-Mar-10 22:55 
GeneralRe: mfc application hangs Pin
Abinash Mohanty18-Mar-10 23:15
Abinash Mohanty18-Mar-10 23:15 
GeneralRe: mfc application hangs Pin
Emilio Garavaglia19-Mar-10 0:00
Emilio Garavaglia19-Mar-10 0:00 
gethostbyaddr requires you machine to contact a DNS server to resolve the address.
If your DNS configuration is not correct or if the DNS server takes time to resolve (may be because of several indirections)gethostbyname can only wait the answer or wait for the connection timeout to occur (usually 40 seconds, where TCP is used).

Since this call is synchronous, there is no way to run around than multithreading.

All the communication tasks should be accomplished by secondary threads that send messages to the primary one (may be through the main window) as things happens, letting the primary one to manage the GUI by updating it and responding to user inputs.

Of course, you can set a timer that kills the communication thread if it doesn't signal events after a while, but consider that such "while" is not something you should decide (the response time of the DNS is a network administration parameter that is not relevant only to your application).

2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


AnswerRe: mfc application hangs - networking question Pin
Moak19-Mar-10 1:11
Moak19-Mar-10 1:11 
Questionlocalizatio issue Pin
Member 59031018-Mar-10 21:57
Member 59031018-Mar-10 21:57 
AnswerRe: localizatio issue Pin
KarstenK18-Mar-10 22:14
mveKarstenK18-Mar-10 22:14 
AnswerRe: localizatio issue Pin
Cool_Dev18-Mar-10 22:14
Cool_Dev18-Mar-10 22:14 
GeneralRe: localizatio issue Pin
Member 59031018-Mar-10 23:20
Member 59031018-Mar-10 23:20 
QuestionInstalling usb device driver Pin
rahul.kulshreshtha18-Mar-10 21:50
rahul.kulshreshtha18-Mar-10 21:50 
QuestionCopying few bits from a string Pin
Vishal Kumar Soni18-Mar-10 21:27
Vishal Kumar Soni18-Mar-10 21:27 
QuestionRe: Copying few bits from a string Pin
CPallini18-Mar-10 21:44
mveCPallini18-Mar-10 21:44 
AnswerRe: Copying few bits from a string Pin
Vishal Kumar Soni18-Mar-10 22:27
Vishal Kumar Soni18-Mar-10 22:27 
GeneralRe: Copying few bits from a string Pin
CPallini18-Mar-10 22:40
mveCPallini18-Mar-10 22:40 
GeneralRe: Copying few bits from a string Pin
Vishal Kumar Soni19-Mar-10 0:09
Vishal Kumar Soni19-Mar-10 0:09 
AnswerRe: Copying few bits from a string Pin
Cool_Dev18-Mar-10 22:09
Cool_Dev18-Mar-10 22:09 
AnswerRe: Copying few bits from a string Pin
LittleYellowBird18-Mar-10 22:26
LittleYellowBird18-Mar-10 22:26 
GeneralRe: Copying few bits from a string Pin
Vishal Kumar Soni18-Mar-10 22:31
Vishal Kumar Soni18-Mar-10 22:31 
GeneralRe: Copying few bits from a string Pin
LittleYellowBird18-Mar-10 22:40
LittleYellowBird18-Mar-10 22:40 
GeneralRe: Copying few bits from a string Pin
Vishal Kumar Soni19-Mar-10 0:10
Vishal Kumar Soni19-Mar-10 0:10 
QuestionRestrict Window move Pin
Anu_Bala18-Mar-10 21:13
Anu_Bala18-Mar-10 21:13 

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.