Alternativelly, we could define server() outside the library, then "inject" in the same fashion that IoTAgent injects smlTreat() (or similar name). This way, it would be more "fair" in the sense that both CB and IoTAgent applications will use the library in the same way... although it could complicate the CB implementation.

Bottom line: if makes sense and it is ease to do, we could define the server function outside the library. If it is complex, forget this comment and mark it with NTC :)