Fix #119 by making client class accept int32 instead of uint16.
Fix bug with client connect function not clearing previous closed socket state.
applied upstream updates