exchange data via TCP socket