add sample code
bugfix:handshake.sync; add maxidletimeseoncds support
update connect/handshake error logic and tests