hmng / jsonrpc-c

JSON-RPC in C (server only for now)
MIT License
220 stars 98 forks source link

Missing deregister procedure #1

Closed mathben closed 11 years ago

mathben commented 11 years ago

Hi, thanks for this work. I complete deregister_procedure and encapsulate en_loop into into jsonrpc-c. On next branch, i will add option to use select or ev.

hmng commented 11 years ago

Hi, thank you for finding the code useful and contributing! I just have a few comments; A simple one: jrpc_procedure_destroy() should be static, as it's only for internal use. The other is that we now have 3 calls to start (init, start, run) vs 2 to stop (stop,destroy). Maybe the code in start() should be in init(). Let me think this through, also the encapsulation of libev. I'm thinking of an init_default() and an init_with_loop( evloop ). Like I say in the Readme, I was already using libev, it's over kill for a server, but *might_ be useful if the library is also a RPC client, because of the need for timers.

mathben commented 11 years ago

Thanks for your comments. I am agree with it. Now, we can init with "jrpc_server_init(...)" or "jrpc_server_init_with_ev_loop(...)". "jrpc_server_start" is private and calling in init. Internal function is now static.

hmng commented 11 years ago

Thanks!