When fetching data via TcpReceive, do not check if the socket is closed. This is because HTTP server would close the connection as soon as the data are sent(in HTTP 1.0 mode).