You don't get the whole result because you don't read the whole result. Instead you stop reading earlier than that because of this:
By the way, that readLine() method is deprecated. The API documentation has some suggestions about what
you should be using instead.
Also, you said this:
When i use the URL class getcontent I get all the html, but i need to use sockets.
That doesn't quite make sense to me, as the URL class
does use sockets. So if you use that, you
are using sockets.