Project

General

Profile

Best way to connect wt to another app

Added by Markus Wolters over 12 years ago

Hi,

after playing with wt a bit I want to try a real app. I already have a qt based server, for that I need one or more frontends. One option should be a wt based web site. Could you make a proposal, how to connect these two programms?

Thought about xml/jsonrpc, but this would be uni directional (I even know if there are any modules/plugins for wt and qt).

Thanks Markus


Replies (4)

RE: Best way to connect wt to another app - Added by Koen Deforche over 12 years ago

Hey Markus,

To start, you could consider the Wt frontend in a similar way as a desktop client frontend. Thus each application instance connects to your server through the same way a desktop client would connect (using a TCP connection?). You could support event handling from server to client as well (i.e. asynchronous behaviour), but then you might consider to use boost::asio to manage this for you. You should post these events to a session using WServer::post().

Later you may want to revisit this and have only a single connections per Wt process (shared by all sessions in that process), if you want to keep the number of connections down. Or you could use a pool (e.g. this is typically what you do to connect to a database process).

Regards,

koen

RE: Best way to connect wt to another app - Added by Markus Wolters over 12 years ago

Hi Koen,

unfortunately there is no desktop client yet. I'm undecided if I should choose json- or xmlrpc. Do you know any implementation of one of these for use with wt?

RE: Best way to connect wt to another app - Added by Koen Deforche over 12 years ago

Hey,

No, not really but I would be surprised if there aren't any good ones out there (if that's the case it would be time for us to write some).

We've used json with JWt using the gson library.

And I think a json backend would be easy to add to Wt::Dbo !

The idea would be to use these messages over a plain TCP connection ?

Regards,

koen

RE: Best way to connect wt to another app - Added by Markus Wolters over 12 years ago

Hi,

true xmlrpc uses http as transport, I think. But I could imagine a stripped down version with json and plain tcp, if it is easier to write. I must admit that I don't want to spend much time on implementing this part of the software ;)

Regards,

Markus

    (1-4/4)