send object over tcp socket