Guest_imported
New member
- Jan 1, 1970
- 0
I have a Visual C++ (Winsock2) application that listens on port 1170. Sometimes it seems to stop whenever a new connection comes in (TCP/IP driver accepts connection fine). It would take off if I press any keyboard key. Weird thing is that app logic does not require any keybord input, no scanf(..) anywhere. This problem only happens under the following conditions.
1- Windows 2000 Professional or Server (SP2)
2- Application puts messages to the standard output or stderr using printf() or fprintf()
code looks like this:
Thread priority is set to THREAD_PRIORITY_HIGHEST
Thread myserver(){
soc = socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
bind(soc;;
listen(soc,SOMAXCONN);
for(;{
newsocket = accept(soc,NULL,NULL);
// PROBLEM HAPPENS SOMETIMES ONLY IF NEXT
// STATEMENT IS ENABLED. I MUST have some
// debugging messages.
fprintf(stderr,"New connection!!!\n"
}
} // end of thread myserver
I would appreciate your help very much.
Maurice.
1- Windows 2000 Professional or Server (SP2)
2- Application puts messages to the standard output or stderr using printf() or fprintf()
code looks like this:
Thread priority is set to THREAD_PRIORITY_HIGHEST
Thread myserver(){
soc = socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
bind(soc;;
listen(soc,SOMAXCONN);
for(;{
newsocket = accept(soc,NULL,NULL);
// PROBLEM HAPPENS SOMETIMES ONLY IF NEXT
// STATEMENT IS ENABLED. I MUST have some
// debugging messages.
fprintf(stderr,"New connection!!!\n"
}
} // end of thread myserver
I would appreciate your help very much.
Maurice.