add functions for sync connection
rename test.cc to example.cc
remove typedef