Does anyone have a sample of THttpApiServer (found on Synopse)? I am not able to find any document about creating a simple webserver using this class.
Asked
Active
Viewed 1,821 times
3
-
1First hit with google, [HTTP server using fast http.sys kernel mode server](http://blog.synopse.info/post/2011/03/11/HTTP-server-using-fast-http.sys-kernel-mode-server) looks like it have all the information needed to try the component. – jachguate Mar 23 '11 at 13:59
-
This page contains no sample at all. – Rafael Colucci Mar 23 '11 at 14:05
-
I can see a program on that page. – David Heffernan Mar 23 '11 at 14:13
-
Yes, but it is not a sample. It only shows one component function – Rafael Colucci Mar 23 '11 at 14:40
-
@Rafael You probably need to read the source. – David Heffernan Mar 23 '11 at 14:48
-
I just did and i was able to get it working, but some sample would be nice. – Rafael Colucci Mar 23 '11 at 16:23
-
@Rafael As stated, IMHO there's the information you need to try the component, not necessarily a working code sample. A sample IS nice and if you have one working sample now, be or guest and post it as an answer to your own question, so other people can find it when in your early situation. – jachguate Mar 23 '11 at 17:25
1 Answers
5
You could have used our forum to ask this! ;)
The class is self-explained: please read all comments of all properties and methods, and you'll find here all useful information.
I've just uploaded a demo of this component.
It's able to serve some hard drive content, using a virtual directory layout. Directory list is created in Delphi code. File downloads are handled by http.sys at kernel-level mode.
See this new file available in our Source Code Repository.

Arnaud Bouchez
- 42,305
- 3
- 71
- 159
-
Is this class stable? I mean, can I use it in a production environment ? – Rafael Colucci Mar 24 '11 at 16:34
-
I just wrote this class. From my tests, it works fine. Most of the work is done by http.sys itself. I've written this wrapper using the official documentation from Microsoft. It's also tested in the automated regression tests of our framework. I know some companies using http.sys as their main http server on production. It's very reliable under Windows: it's the core of IIS. – Arnaud Bouchez Mar 24 '11 at 17:29
-
Ok .. I will give it a try. I am using indy to build my webservers, but I think that indy is very slow sometimes and theres nothing i can do to speed it. Do you think http.sys is faster than indy? – Rafael Colucci Mar 24 '11 at 20:26
-
In all cases, http.sys is faster than Indy, because it runs in Kernel mode, and that it was optimized for speed. You could even speed up our implementation by adding the "content cache" feature. Indy will be definitively slower because: it uses a lot of code (in which some part is not optimized), does not use I/O completion ports, run in user mode, has an old design (even for latests versions). – Arnaud Bouchez Mar 25 '11 at 13:20
-
1Well .. My webserver generates different data for every request received, so i cant use content cache. But I will definitely give your code a try. Btw, you did a good job in this class. – Rafael Colucci Mar 25 '11 at 13:27
-
Another thing: can you give me a link explaining what you mean by " I/O completion ports" ? – Rafael Colucci Mar 25 '11 at 13:27
-
Just google for it [IOCP](http://en.wikipedia.org/wiki/Input/output_completion_port) or search in [SO](http://stackoverflow.com/questions/2302267/is-there-a-i-o-completion-port-based-component-for-delphi) – Arnaud Bouchez Mar 27 '11 at 13:30