Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Real time web based client for delphi app. HOWTO?

First of all what I want is quite complex, at least for me, but on the other hand it sounds exciting.

I have a software written in delphi, and I want a real time web based client for it.

The requirements:

  • On the client side pure Javascript
  • Shiny interface ( GWT, SmartGWT )
  • Asynchronous connection between the server and the client. Ajax push, Long Polling, Comet, WebSocket?

On the server side

  • scale-ability

On the delphi side I think I could use ICS from Overbyte, to handle the requests. I know that THttpAppSrv from ICS pack can easily serve simple content, but what about Websocket, or how can I do long polling with it?

What do you think, is it a good combo ( GWT, SmartGWT on the client side, and ICS on the delphi side ), is there any sample project out there, or is there any other solution?

Update Thanks for the useful comments, I think I get closer to the solution. It's good to know that GWT can use a custom server, however I think Arnaud is right, GWT with it's own Jetty server is a complete solution, but unfortunately not for me. :) I think I need a server written in delphi, which can communicate with GWT RPC.

Update 2 I accepted Arnaud Bouchez's answer which looks me the best for the original question, however I think there's a better solution (if you change the requirements a little) for creating a client running in the browser for a delphi application. I just make a little comment here, to share the idea. Finally I used a node.js server, and connected it to my delphi app with the help of ZMQ.

like image 541
balazs Avatar asked Aug 25 '11 15:08

balazs


2 Answers

About the HTTP server on the Delphi side, consider using the kernel mode http.sys server provided by Microsoft since XP. Should be faster than ICS.

For the AJAX part, take a look at Op4JS or up to come ElevateDBBuilder.

What is great with those solutions is that you can write object pascal code, and that this code will be translated to JavaScript. Not yet finished, but worth waiting a little for their release time.

Of course, more classic AJAX solutions do exist, like IntraWeb or ExtPascal. Both implement their own web server.

About GWT, AFAIK they are java libraries, deeply linked to the Java world. You won't be able to make it work with Delphi.

Edit about GWT:

GWT is a full Client-Server framework.

If you go with GWT, I suspect you'll end with a full Java rewrite of the application at some point. Or you'll miss most interest of GWT as a framework. It's your choice.

I'd rather rely on some more standard approach, using JSON for communication for instance as we do with our framework.

like image 178
Arnaud Bouchez Avatar answered Oct 17 '22 12:10

Arnaud Bouchez


Have you checked out Intraweb? I have not used it extensively myself - but it seems to be quite popular for Delphi web apps.

I have made several Web Apps using TWebBroker with either IIS or Apache. It is Asynchronous, and allows you to easily port/share Delphi code with your other application. And it would support Ajax calls.

like image 1
M Schenkel Avatar answered Oct 17 '22 12:10

M Schenkel