After you read all the data, are you closing the socket? I suspect the host is closing the socket at the end as you are using http 1.0. However, this is not guaranteed with some servers...
Add a System.print() message inside the onClose function to check.
I suspect you are running out of sockets. I think there is a limit of 16 or 64 sockets that can be open at one time.