Below is a sample .ini file
Below is the askserver.c source file. First the configurations are loaded and waiting for incoming requests. Then whenever a request is arrived the server check for the file requested. If it is available send a message code 200 and the file type server is going to send to the client. If the requested file was not fond, then send the message code 400 content not found.
When a available file is send to the client, method is used.
sendfile(destination, source, offset,size);
I have included a sample www folder in the same directory to simulate the web server.
Download the full project from here.... DOWNLOAD
How to Test the Sample ASK Server.
Open a Terminal and Type the Following Commands.
[aruna@ubuntu]~$ ./askserver 7788
The argument 7788 is the port that we bind the webserver. Now open a web browser and type the following address localhost:7788
You'll see the web server is up and running. :)