First version of tcp event mechanism
fixed code styling
add possibility to enable/disable tcp api