Go Back   FlashFXP Forums > >

Programming Need help with C/C++/Delphi? Ask here and make us all laugh.

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-12-2004, 05:36 PM   #1
mr_F_2
Senior Member
 
Join Date: Jan 2004
Posts: 203
Default making a winsock listen loop in C

i'm wondering about this, for the purpose of server applications. every loop i've ever made to listen for connections utilizes close to 100% cpu because of constant conection checks.

basically i always end up with something like this (in psuedocode)

main {

pre configuration routines;
open socket for listening;

loop {

if (conection) {
dosomething
}

close socket;
post routines;
return;

}

how do i do this better, or how do i make it utilize less cpu resourcees? i'm good with C but am not familiar with the available windows API, so i don't really know about controlling cpu utilization via setting a variable or whatever.. please help
mr_F_2 is offline  
 

Tags
close, conection, cpu, loop, routines;


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:08 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)