For some reason the TCP connection just won't work if I do not try to read out the data every time. (Need to investigate, for now, this hack works.)