Jump to content

Two different clients


Rav
 Share

Recommended Posts

I assume you mean two servers working against the same database,

on the same physical server - and that is no problem.

 

But of course not on the same port - as only one server process

can listen to a port at a time, on a single IP, as it locks it.

 

So you can just run them in the same folder, but on 8077

and 8088 for example, if you just test with standalone.

 

To create two different "client" versions from a single

server process, you need some trigger mechanism that tells

the single server what to deliver - could be anything like

something in the url to the average temperature of LA

on that day...and it produces one of two versions.

 

If you need two servers on the same port, the server IPs

must be different, and then again folders dont matter.

Link to comment
Share on other sites

do you mean two different customers connect at the same server at two different applications?

Yes, one database, one server, but two different clients with different main windows.

 

I assume you mean two servers working against the same database,

on the same physical server - and that is no problem.

 

But of course not on the same port - as only one server process

can listen to a port at a time, on a single IP, as it locks it.

 

So you can just run them in the same folder, but on 8077

and 8088 for example, if you just test with standalone.

No it's not an option, server should be only single. I know there can be only one port per server, so I added the "First" and the "Second" parts in URL to distinguish the clients.

 

To create two different "client" versions from a single

server process, you need some trigger mechanism that tells

the single server what to deliver - could be anything like

something in the url to the average temperature of LA

on that day...and it produces one of two versions.

Yes, exactly, I need such mechanism but don't know how to create it cause the main Unigui form is created automatically.

Link to comment
Share on other sites

Yes, one database, one server, but two different clients with different main windows.

 

No it's not an option, server should be only single. I know there can be only one port per server, so I added the "First" and the "Second" parts in URL to distinguish the clients.

 

Yes, exactly, I need such mechanism but don't know how to create it cause the main Unigui form is created automatically.

 

 

If you look at the URLParameters demo, the parameters are accessible

in the onShow event of the main form, and that means you can at that 

point change whatever you want, depending on the parameter, before

the "client experience" is produced by the unigui http server.

 

At the simplest level, you can change/adapt design-time interface elements

here, or fully create the two interfaces at runtime on show, or doing it more complex,

you can load two different html files into one htmlframe, and go from there,

with the ajaxrequest handling two different event sets from the two different

html/javascript setups.

Link to comment
Share on other sites

At the simplest level, you can change/adapt design-time interface elements

here, or fully create the two interfaces at runtime on show, or doing it more complex,

you can load two different html files into one htmlframe, and go from there,

with the ajaxrequest handling two different event sets from the two different

html/javascript setups.

You gave me even a simpler idea - to use TUniPageControl hiding all its pages except the one that corresponds to the current client.

Thanks!

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...

Hi, and sorry for raising old topic instead of creating a new one.

I alsow need a few different main forms, but on the one port and url. Depending on the user login (for ex - user and admin).

Is it correct and safe to do so:

procedure TMainForm.UniFormShow(Sender: TObject);
begin
 if UniMainModule.ShowSecond then
 begin
  Hide;
  UniForm1.Show;
 end;
end;

?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...