how to destroy or end tcp socket