Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » JsonRPC support
JsonRPC support [message #36836] Tue, 10 July 2012 22:47 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
U++ now has support for JsonRpc; it is merged with existing support of XmlRpc, as two protocols are quite similar. Server simply detects the request protocol and can even handle it using the same RPC_METHOD:

http://www.ultimatepp.org/reference$Rpc$en-us.html

(of course, some methods are exclusive for one or another - XmlRpc does not have named parameters, JsonRpc can return only a single Value).

In the process, I have also introduced some new notations as demonstrated in Multiply2 method.
Re: JsonRPC support [message #37773 is a reply to message #36836] Sun, 11 November 2012 18:54 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Mirek, I would be really grateful if you provided multi-threaded example of rpc server. I wonder what's the best way to handle multiple requests. Thank you in advance.
Re: JsonRPC support [message #37774 is a reply to message #37773] Sun, 11 November 2012 20:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Do not really have time to provide tested example, but it should be something like:

for(;;) {
	TcpSocket rpc;
	accept_mutex.Enter();
	if(!rpc.Listen(port, 5))
		return false;
	accept_mutex.Enter();
	TcpSocket http;
	if(listen_socket.Accept(rpc))
		RpcPerform(http, NULL);
}


...create a reasonable work thread pool and start do this loop in all of them...
Re: JsonRPC support [message #37777 is a reply to message #37774] Sun, 11 November 2012 21:36 Go to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Thanks! I'll try to add the example if I succeed.
Previous Topic: Two small ide improvements
Next Topic: Major Draw / CtrlCore refactor
Goto Forum:
  


Current Time: Thu Apr 18 11:08:14 CEST 2024

Total time taken to generate the page: 0.01474 seconds