Changes introduced in 3.4.2 were mostly to get networking code working in mingw environment. The naming collition of ASSA::ERROR logging mask was resolved by renaming it to ASSA::ASSAERR.
3.4.1 | 3.4.2 |
---|---|
ASSA::ERROR | ASSA::ASSAERR |
It was discovered by trial-and-error that you cannot set Socket into blocking mode. Instead, a Socket can either have O_NONBLOCK flag set or cleared. Therefore, Socket::blocking option was removed. Use Socket::turnOptionOn (nonblocking) and Socket::turnOptionOff (nonblocking) respectively to manipulate the flag.
Changes introduced in 3.4.2 were mostly to get networking code working in mingw environment. The naming collition of ASSA::ERROR logging mask was resolved by renaming it to ASSA::ASSAERR.
3.4.1 | 3.4.2 |
---|---|
ASSA::ERROR | ASSA::ASSAERR |
It was discovered by trial-and-error that you cannot set Socket into blocking mode. Instead, a Socket can either have O_NONBLOCK flag set or cleared. Therefore, Socket::blocking option was removed. Use Socket::turnOptionOn (nonblocking) and Socket::turnOptionOff (nonblocking) respectively to manipulate the flag.
The interface changes intruduced in version 3.4.0 break backward compatability with the previous versions of the library. This is mostly due to the *feature* of cygwin development tools that fail to differentiate between Assert.h in your build directory and system-wide /usr/include/assert.h file.
The file assa/Assert.h, therefore, has been renamed to assa/Assure.h.
3.3.x | 3.4.x |
---|---|
Assert_exit(exp_) | Assure_exit(exp_) |
Assert_return(exp_) | Assure_return(exp_) |
Assert_return_void(exp_) | Assure_return_void(exp_) |
Assert_return_value(exp_, value_) | Assure_return_value(exp_, value_) |
Also, a whole lot of function and data member names has been *normalized* in two classes, GenServer and Singleton in order to improve code readability and consistency. The complete list of changes is listed in the tables below.
3.3.x | 3.4.x |
---|---|
getInstance() | get_instance() |
3.3.x | 3.4.x |
---|---|
getReactor() | get_reactor() |
initServer() | init_service() |
processServer() | process_events() |
fatalSignalHook() | fatal_signal_hook() |
stopServer() | service_is_active() |
setStopServerFlag() | stop_service() |
displayHelp() | display_help() |
getProcName() | get_proc_name() |
setProcName() | set_proc_name() |
getCmdLineName() | get_cmdline_name() |
getStdConfigName() | get_default_config_file() |
getAltConfigName() | get_config_file() |
getPortName() | get_port() |
setPortName() | set_port() |
becomeDaemon() | become_daemon() |
initInternals() | init_internals() |
get_version() |
In case of stopServer() member function, the event processing loop typical for ver. 3.3.x or prior should be modified in the following fashion:
// ver. 3.3.x and prior while (!stopServer()) { m_reactor.waitForEvents (); } // ver. 3.4.x while (service_is_active ()) { m_reactor.waitForEvents (); }
To accommodate a certain way of initializing applications written with libassa, the way BOOL command-line arguments are parsed and interpreted was changed. In the previous versions, a whole group of options was used as flags. For example, --daemon option was used to tell libassa to deamonize the process. This has been changed to --daemon=BOOL format where BOOL is either "yes" or "no" (any other combinations are invalid and would result in the value being interpreted as "no").
libassa still supports flag options (i.e. --help), but they should be rather an exception then a commonplace practice.
This change is driven by the desire to give an application writer the fullest level of initialization control. The order of initialization is as follows:
NOTE: This change has sudden sude-effect. If you forget to adjust the way you pass your old *flag* command-line argument to your program, the value assigned to it would be "no" by default! So, say what you mean with "yes"!
3.3.x | 3.4.x |
---|---|
m_debug_mask | m_mask |
m_alt_config_name | m_config_file |
m_std_config_name | m_default_config_file |
bool m_with_log_server | string m_with_log_server |
bool m_log_stdout_flag | string m_log_stdout |
bool m_daemon_flag | string m_daemon |
bool m_ommit_pidflock_flag | string m_ommit_pidfile |
If you use automake tools, modify your configure.in (or configure.ac) accordingly:
dnl ----------------------------- dnl Pick up ASSA library flags. dnl ----------------------------- PKG_CHECK_MODULES(ASSA, assa-3.4 >= 3.4.0) AC_SUBST(ASSA_CFLAGS) AC_SUBST(ASSA_LIBS)