You are not logged in.
Can I create multiple server types TSQLite3HttpServer in the same machine?
Should I create multiple instances of type server TSQLite3HttpServer with different ports (if I create multiple server instances with the same port "Es 888",Not working)
I would write an application that connects to multiple files residing on the server, but I do not know the port number I know the name of the file in the server.
What should I write?
Thanks
Offline
In the current implementation of TSQLite3HttpServer, it's only serving one TSQLRestServer instance per server.
By TCP/IP design, you'll have to use a diverse port for multiple TSQLite3HttpServer instances.
You could make some modifications to TSQLite3HttpServer to enable it handle multiple TSQLRestServer instances.
This each TSQLRestServer instance has its own "root" URI name, one unique TSQLite3HttpServer is able to server multiple TSQLRestServer instances.
I don't have the time to do the modification now (I'm working on PDF/A-1), but perhaps in the near future.
Offline
Thank you think using TSQLRestServerNamedPipe solve my problem?
Do you think that it is complicated to manage TSQLite3HttpServer for multiple instances?I mean, I could make the change or is too complicated?
Offline
It will be the same problem with TSQLRestServerNamedPipe.
You can take a look at TSQLite3HttpServer class implementation. Make yourself an idea.
I'll try to make the change now, because I've finished PDF/A-1 implementation.
Offline
ok Thanks
Offline
OK - TSQLite3HttpServer now handle multiple TSQLRestServer instances per one server (dispatching requests via the Root URI used).
A new constructor just takes an open array of TSQLRestServer instances...
HttpServer := TSQLite3HttpServer.Create('8080',[FirstSQLRestServer,SecondSQLRestServer]);
Offline
ok I tested the code and I saw that work if I try to open 2 file db3 from one server application,but does not work if I create a server program that opens a file on the server with port (eg 888) and I run it 2 times,how do I make a server program that opens multiple files if I do not know the number of the file that I want to open, I can add files to the server in a second time?
Thanks
Offline
By design, you can't launch two servers on the same port.
But your request does make sense.
I've just added a new AddServer method, to register a TSQLRestServer after launch of the HTTP server main instance.
See http://synopse.info/fossil/info/0245ffe22e
Offline
ok thanks, I just tried your modification and it works very well thanks again.
Now I have to create a program that manages all the files that I want to run the server, and then be able to create client programs that connect to different server files db3.
Offline