Tuesday, March 4, 2008

gen_server

Some changes were commited yesterday. Probably the most important is that definition servers are now implemented using gen_server behaviour. It was really easy to change the plain Erlang approach to the OTP based one so there is no reason to have any fear of OTP.

In addition to this, diameter module is now implemented using the supervisor behaviour. Functionality has not changed, but at least the foundations to take advantage of OTP have been laid. The statements to test the examples are now:
diameter:start_link().
PidC = diameter_client:start().
PidS = diameter_server:start().

Other minor changes are:
  • Encoded command headers now have different End-To-End-Id and Hop-By-Hop-Id. Previously they were just set to 0, which is not compliant with RFC3588.
  • Encoded command contents are now printed so it's easier to debug looking at the messages that are being send and received.

2 comments:

Vance said...

You could make diameter_server and diameter_client OTP compliant using gen_server or gen_fsm. You just need to handle receiving in the handle_info callback.

jcc said...

Hello Vance. Yes, that's a good idea. I will work on it. Thanks for pointing me to the right direction in this project.