Hi,
we talked about tntnet configuration and I changed configuration to xml
in svn.
I talked with some people about that and they thought, that using json
would be a good idea. Today I implemented it just as an experiment. It
is really trivial to switch to json with the cxxtools serialization
framework, which is used now.
One problem, what occurred was, that json do not support comments. There
are suggestions, that json parsers should allow comments. I feel, that
this is a good idea and implemented comments (C-style with /* ... */ and
C++-style using //) in the json parser. So this is solved.
I see some advantages using json also, so I would like to ask again
about your thoughts now that we have a experimental support for that.
The current svn version of tntnet can be started with a json
configuration file with "tntnet -j tntnet.json". And here is a
configuration file from the calc demo:
{
/*
This is the main configuration file for tntnet.
**/
"mappings" : [
{
// map / to calc@calc
"url" : "^/%",
"target" : "calc@calc"
},
{
// /comp.* or /comp to comp@calc
"url" : "^/([^.]+)(\\..+)?",
"target" : "$1@calc"
}
],
// listen to a port (empty string means any local interface)
"listeners" : [
{
"ip" : "",
"port" : 8000
}
],
"logproperties" : "tntnet.properties",
"compPath" : [ ".libs" ]
}
So what do you think? I'm a little confused since I like both ideas and
there is no clear vote for one or the other.
I have a software installed on my system called yajl (yet another json
library), which has a command line tool "json_verify", which can also
verify json files. Using command line option -c it even supports comments.
Tommi
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general