fix bug in XML while threading

Signed-off-by: anti-freak <antifreak2011@gmail.com>
some typedefs and connect corrections

Signed-off-by: anti-freak <antifreak2011@gmail.com>