Is a server an infinite loop running as a background process?

Posted by Tony on Stack Overflow See other posts from Stack Overflow or by Tony
Published on 2010-04-28T12:53:54Z Indexed on 2010/04/29 8:27 UTC
Read the original article Hit count: 185

Filed under:
|
|

Is a server essentially a background process running an infinite loop listening on a port? For example:

while(1){
   command = read(127.0.0.1:xxxx);
   if(command){
      execute(command);
   }
}

When I say server, I obviously am not referring to a physical server (computer). I am referring to a MySQL server, or Apache, etc.

Full disclosure - I haven't had time to poke through any source code. Actual code examples would be great!

© Stack Overflow or respective owner

Related posts about servers

Related posts about c