#1 2014-05-25 14:32:03

ulutepe
Member
Registered: 2014-05-23
Posts: 6

Need Suggestion About Structure

Explanation:
i want to design a server which will use only socket or wininet like indy's TIdTCPServer. Not want REST because of http.sys's needs admin privileges so;

i will transport my own datasets and objects with encryption (Not SSL i will write it myself) to client side and maybe i will declare a few event.
also i will transport files too. the database which will i use is not important on server side.

Question:
so can anyone suggest me that which mormot objects i can use with his scenario? an example will be better:)

Offline

#2 2014-05-25 14:45:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Need Suggestion About Structure

http.sys needs admin priviledge only ONCE, when registering the URI.
You can do this e.g. at server installation, just once.
Then the server will run without admin priviledge.
See for instance TestSQL3Register.dpr and TestSQL3.dpr.

Otherwise, there is a pure socket HTTP server in mORMot, in the class THttpServer of SynCrtSock.
But it performs less well than http.sys in highly concurrent access.
So on production, the THttpApiServer http.sys server is always to be preferred.

To be precise, I guess it performs much better than Indy's TIDCTPServer, since it feature IOCP and a thread pool.
There is all information in the SAD 1.18 pdf documentation, and in the SynCrtSock.pas unit.

You can switch from one kind of server to the other with the aHttpServerKind: TSQLHttpServerOptions parameter of TSQLHttpServer.Create() constructors.

Offline

#3 2014-05-25 14:52:05

ulutepe
Member
Registered: 2014-05-23
Posts: 6

Re: Need Suggestion About Structure

Thanks for reply.

i already used http.sys structure i really liked it bu i want to use a TCP based and encrypted structure and i read all 1.17 documantation and i saw coparation of wininet,http.sys and socket speeds
i will read now 1.18 SAD. i only dont  know which mormot objects will i use smile

Offline

#4 2014-05-25 14:56:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Need Suggestion About Structure

HTTP is just a thin layer over TCP.
There won't be any benefit in comparison to http.sys, on the server side.

You can encrypt the content on any mORMot server - see http://blog.synopse.info/post/2014/01/0 … -over-HTTP

As I wrote above, you do not have to change any objects, just set the aHttpServerKind: TSQLHttpServerOptions parameter of TSQLHttpServer.Create() constructors.

Offline

#5 2014-05-26 06:03:59

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Need Suggestion About Structure

Arnaud, I suggest to move TestSQL3Register.dpr to a subfolder inside the 'Samples' folder for easier discovering.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#6 2014-05-26 06:55:17

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Need Suggestion About Structure

TestSQL3Register.dpr is a "twin program" to TestSQL3.dpr, so it does make sense to be in the same folder.
Its use is clearly stated in the doc, even the Readme.txt file.

Even the whole http.sys URL registration process is clearly described in the SAD 1.18 pdf.

But I've added a Project04ServerRegister.dpr program in the Sample subfolder, so that it would be of obvious use.
See http://synopse.info/fossil/info/67a189846a

Offline

Board footer

Powered by FluxBB