- I identified a possible entry point for delivering packets from mod_megaphone.
- I started coding up mod_megaphone.
- IT'S ALIVE!!
Unfortunately, erlang is not quite that easy to work with. I spent a good deal of time chasing down an annoying problem where the code was compiling, testing OK, but ejabberd was refusing to load it. But not to worry, I was getting the following, very helpful error message:
undef
There is a school of thought that says "less is more" when writing software and I do agree with it. That error message, however, goes a bit too far.
For the curious, the following statement was compiling OK. I was able to load it and run the code that was not part of the conditional that it belonged to:
BinConnectionId = binary_part(Binary, ?CONNECTION_ID_INDEX, ?CONNECTION_ID_LENGTH),
The correct statement is
BinConnectionId = binary:part(Binary, ?CONNECTION_ID_INDEX, ?CONNECTION_ID_LENGTH),
Did you notice how the underscore was replaced with a colon? You did? Well, why didn't you tell me earlier?!! At any rate, this was the cause of much hair tearing, but I did finally end up catching it.
No comments:
Post a Comment