c - Is a server an infinite loop running as a background process? -
is server background process running infinite loop listening on port? example:
while(1){ command = read(127.0.0.1:xxxx); if(command){ execute(command); } }
when server, not referring physical server (computer). referring mysql server, or apache, etc.
full disclosure - haven't had time poke through source code. actual code examples great!
that's more or less server software does.
usually gets more complicated because infinite loop "only" accepts connection , each connection can handle multiple "commands" (or whatever called in used protocol), basic idea this.
Comments
Post a Comment