read tcp data without broken tcp connection in a better way