searcher1234 wrote:
I just start learning network programming. How can I write a web
server with "C" so that it can connect to web browser and read the
request, accept the request, open requested html page, send it
back to the web browser for user viewing.
One more is how can i allow multi-users send request to the web
server?
if possible, Could you post sample code?
Sure:
int main(int argc, char **argv)
{
abrowser brow;
arequest request;
if (validateargs(argc, argv) {
brow = openbrowser(argv[1]);
while (request = getrequest(brow)) {
view(open_page(request));
}
}
return 0;
}
should do it, once you flesh it out with a few #includes, data
definitions, functions, etc.
--
"I support the Red Sox and any team that beats the Yankees"
"Any baby snookums can be a Yankee fan, it takes real moral
fiber to be a Red Sox fan" - "I listened to Toronto come back
from 3:0 in '42, I watched Boston come back from 3:0 in '04"