Thread overview
client/server framework
Feb 02, 2007
Alberto
Feb 02, 2007
kris
Feb 02, 2007
Alberto
Feb 03, 2007
kris
Feb 03, 2007
John Demme
Feb 03, 2007
Alberto
Feb 03, 2007
John Demme
February 02, 2007
There is a client/server framework for D? maybe something like
quickserver for java.
I need also a framework for making RPC calls between client and server
(something like dualrpc in java).
For rpc I know mango.xml.rpc, that isn't exactly what I need, but..
mango.xml.rpc is "under construction", someone have tested it? I need it
for a complex application, it must be stable.
ps: I could use mango.http.client and mango.http.server, but essentially
I don't want/need http..
pps: I can code a VERY simple (I'm not a good programmer) framework  by
myself, but it will take a lot of time, possibly I prefer code my
application :P
February 02, 2007
Alberto wrote:
> There is a client/server framework for D? maybe something like
> quickserver for java.
> I need also a framework for making RPC calls between client and server
> (something like dualrpc in java).
> For rpc I know mango.xml.rpc, that isn't exactly what I need, but..
> mango.xml.rpc is "under construction", someone have tested it? I need it
> for a complex application, it must be stable.
> ps: I could use mango.http.client and mango.http.server, but essentially
> I don't want/need http..
> pps: I can code a VERY simple (I'm not a good programmer) framework  by
> myself, but it will take a lot of time, possibly I prefer code my
> application :P

Mango has a Servlet engine: the http-server is simply a wraper on top. There's a few servlet examples in the Mango codebase, showing how to set things up, and it's pretty simplistic (no config files).

The servlet engine has been stable for getting close to 3 years now, so it might work for you? However, it does not support chunking at this time (if that's important to you).

Talking to a servlet from a client is as simple as opening a socket to it, and sending the appropriate protocol request. For servlets, the protocol generally used is the HTTP GET/POST/HEADER style. That does not mean the servlets are HTTP/HTML limited; only that the /path/ specified in the request is used to map a request to the appropriate servlet implementation. After making the request, the delivery protocol is entirely between the client itself and the servlet on the other end :)

You can happily use the HttpClient for talking to the Servlet engine ... all it does is set up the (above) HTTP request and set things in motion. The reply from the server can be any kind of data/encoding you wish (e.g. not HTML). At that point, the data is purely a stream of bits.

Mango works with Phobos and with Ares, via a -version switch. There's also a version of the servlet engine that operates with Tango instead. In fact, all the high level code in Mango (servlets, http, sax, clustering, etc) all work with Tango. The code for this is currently located in a seperate area while we figure out where to put it :)

Tango already has HttpClient as part of the network protocol support (in tango/net/http). If you're working with phobos, I'd suggest looking at Mango. If you're ready to dive into Tango, then we could point you at the relevant server additions for that instead?

Good luck!

- Kris


February 02, 2007
kris ha scritto:
> Mango works with Phobos and with Ares, via a -version switch. There's also a version of the servlet engine that operates with Tango instead. In fact, all the high level code in Mango (servlets, http, sax, clustering, etc) all work with Tango. The code for this is currently located in a seperate area while we figure out where to put it :)
> 
> Tango already has HttpClient as part of the network protocol support (in tango/net/http). If you're working with phobos, I'd suggest looking at Mango. If you're ready to dive into Tango, then we could point you at the relevant server additions for that instead?
> 
> Good luck!
> 
> - Kris
> 
> 
I'm testing Tango in these days (and I like it), so yes, I'm interested :)
February 03, 2007
Alberto wrote:

> There is a client/server framework for D? maybe something like
> quickserver for java.
> I need also a framework for making RPC calls between client and server
> (something like dualrpc in java).
> For rpc I know mango.xml.rpc, that isn't exactly what I need, but..
> mango.xml.rpc is "under construction", someone have tested it? I need it
> for a complex application, it must be stable.
> ps: I could use mango.http.client and mango.http.server, but essentially
> I don't want/need http..
> pps: I can code a VERY simple (I'm not a good programmer) framework  by
> myself, but it will take a lot of time, possibly I prefer code my
> application :P

Hi!  I wrote the mango xml-rpc stuff awhile back.  It's a bit slow, but I don't know of any bugs in it.  (But I haven't used it in awhile, so I don't even know if it works in DMD1.0.)  I'm currently working on porting mango.xml.sax to tango and will then be porting xml-rpc over to the Tango-compatible SAX.  It should be much, much faster.  I'm not making any guarantees as to API compatibility, though.  In fact, I'm considering re-writing the Xml-Rpc API since I haven't been particularly satisfied with the interface code I've been writing with it.

Expect beta versions of this stuff pretty soon- I've got a big project waiting on it ;)... If you've got any ideas or comments on the new efforts, please let me know- put up a post on dsource's mango forum and we'll discuss it.  I'm pretty open to suggestions on the xml-rpc API right now.

-- 
~John Demme
me@teqdruid.com
http://www.teqdruid.com/
February 03, 2007
> Hi!  I wrote the mango xml-rpc stuff awhile back.  It's a bit slow, but I don't know of any bugs in it.  (But I haven't used it in awhile, so I don't even know if it works in DMD1.0.)  I'm currently working on porting mango.xml.sax to tango and will then be porting xml-rpc over to the Tango-compatible SAX.  It should be much, much faster.  I'm not making any guarantees as to API compatibility, though.  In fact, I'm considering re-writing the Xml-Rpc API since I haven't been particularly satisfied with the interface code I've been writing with it.
> 
> Expect beta versions of this stuff pretty soon- I've got a big project waiting on it ;)... If you've got any ideas or comments on the new efforts, please let me know- put up a post on dsource's mango forum and we'll discuss it.  I'm pretty open to suggestions on the xml-rpc API right now.
> 
That it's a bit slow it's not a big problem for my application (I
think.), what I need is:
server in D
client in d,vb,c#,java,ecc
With http and xml-rpc I think that I can do it, or I'm wrong?
February 03, 2007
Alberto wrote:

>> Hi!  I wrote the mango xml-rpc stuff awhile back.  It's a bit slow, but I
>> don't know of any bugs in it.  (But I haven't used it in awhile, so I
>> don't
>> even know if it works in DMD1.0.)  I'm currently working on porting
>> mango.xml.sax to tango and will then be porting xml-rpc over to the
>> Tango-compatible SAX.  It should be much, much faster.  I'm not making
>> any
>> guarantees as to API compatibility, though.  In fact, I'm considering
>> re-writing the Xml-Rpc API since I haven't been particularly satisfied
>> with the interface code I've been writing with it.
>> 
>> Expect beta versions of this stuff pretty soon- I've got a big project
>> waiting on it ;)... If you've got any ideas or comments on the new
>> efforts, please let me know- put up a post on dsource's mango forum and
>> we'll
>> discuss it.  I'm pretty open to suggestions on the xml-rpc API right now.
>> 
> That it's a bit slow it's not a big problem for my application (I
> think.), what I need is:
> server in D
> client in d,vb,c#,java,ecc
> With http and xml-rpc I think that I can do it, or I'm wrong?


XML-RPC is appropriate for those requirements.  That's actually precisely the reason I started using it.

-- 
~John Demme
me@teqdruid.com
http://www.teqdruid.com/
February 03, 2007
Alberto wrote:
> kris ha scritto:
> 
>>Mango works with Phobos and with Ares, via a -version switch. There's
>>also a version of the servlet engine that operates with Tango instead.
>>In fact, all the high level code in Mango (servlets, http, sax,
>>clustering, etc) all work with Tango. The code for this is currently
>>located in a seperate area while we figure out where to put it :)
>>
>>Tango already has HttpClient as part of the network protocol support (in
>>tango/net/http). If you're working with phobos, I'd suggest looking at
>>Mango. If you're ready to dive into Tango, then we could point you at
>>the relevant server additions for that instead?
>>
>>Good luck!
>>
>>- Kris
>>
>>
> 
> I'm testing Tango in these days (and I like it), so yes, I'm interested :)


If you have an SVN client, then this should get you going: http://svn.dsource.org/projects/tango.mango/trunk

There's some examples in there for servlets and so on. Haven't had the chance to package it for download yet, so you'll hopefully forgive the lack of a handy zipfile.

When using this with Tango, an addition to the -I compiler option might be necessary, depending on where you place the source. I usually locate these 'compatible' libs as a child of the Tango root, such that the usual -I works without modification i.e:

tango
  example
  tango
    io
    text
    math
    net
    ...
  mango
    net
    icu
    ...


- Kris