fix recvData function to return an int so we can check for unexpected disconnections from the server