#1 2011-01-27 11:25:00

corchi72
Member
Registered: 2010-12-10
Posts: 232

I would write a program that connects to multiple files in a Server.

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

#2 2011-01-27 14:01:38

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

Re: I would write a program that connects to multiple files in a Server.

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

#3 2011-01-27 16:32:18

corchi72
Member
Registered: 2010-12-10
Posts: 232

Re: I would write a program that connects to multiple files in a Server.

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

#4 2011-01-27 17:19:17

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

Re: I would write a program that connects to multiple files in a Server.

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.
smile

Offline

#5 2011-01-27 17:27:47

corchi72
Member
Registered: 2010-12-10
Posts: 232

Re: I would write a program that connects to multiple files in a Server.

ok Thanks

Offline

#6 2011-01-27 18:29:41

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

Re: I would write a program that connects to multiple files in a Server.

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]);

See http://synopse.info/fossil/info/7c738e4a5e

Offline

#7 2011-01-28 17:20:42

corchi72
Member
Registered: 2010-12-10
Posts: 232

Re: I would write a program that connects to multiple files in a Server.

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

#8 2011-01-28 17:33:43

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

Re: I would write a program that connects to multiple files in a Server.

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
smile

Offline

#9 2011-01-31 08:46:39

corchi72
Member
Registered: 2010-12-10
Posts: 232

Re: I would write a program that connects to multiple files in a Server.

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

Board footer

Powered by FluxBB